Skip to content

meta: Update changelog for 7.37.1 #7142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
with:
# Parse version from head branch
text: ${{ github.head_ref }}
# match: refs/heads/preprare-release/xx.xx.xx
regex: '^refs\/heads\/preprare-release\/(\d+\.\d+\.\d+)$'
# match: preprare-release/xx.xx.xx
regex: '^preprare-release\/(\d+\.\d+\.\d+)$'

- name: Prepare release
uses: getsentry/action-prepare-release@v1
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.31.1

- fix(browser): Support `async` in stack frame urls (#7131)
- fix(nextjs): Make api route identifier stricter (#7126)
- fix(node): Don't rely on `this` in http integration (#7135)
- fix(replay): Fix missing fetch/xhr requests (#7134)
- fix(tracing): Export `defaultStackParser` from tracing CDN bundles (#7116)

## 7.37.0

- feat: Add source map debug ids (#7068)
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/stack-parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function createFrame(filename: string, func: string, lineno?: number, colno?: nu

// Chromium based browsers: Chrome, Brave, new Opera, new Edge
const chromeRegex =
/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;

const chrome: StackLineParserFn = line => {
Expand Down
25 changes: 25 additions & 0 deletions packages/browser/test/unit/tracekit/chromium.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,31 @@ describe('Tracekit - Chrome Tests', () => {
});
});

it('should parse frames with async urls', () => {
const CHROME_109_ASYNC_URL = {
message: 'bad',
name: 'Error',
stack: `Error: bad
at callAnotherThing (http://localhost:5000/:20:16)
at Object.callback (async http://localhost:5000/:25:7)
at test (http://localhost:5000/:33:23)`,
};

const ex = exceptionFromError(parser, CHROME_109_ASYNC_URL);

expect(ex).toEqual({
value: 'bad',
type: 'Error',
stacktrace: {
frames: [
{ filename: 'http://localhost:5000/', function: 'test', lineno: 33, colno: 23, in_app: true },
{ filename: 'http://localhost:5000/', function: 'Object.callback', lineno: 25, colno: 7, in_app: true },
{ filename: 'http://localhost:5000/', function: 'callAnotherThing', lineno: 20, colno: 16, in_app: true },
],
},
});
});

it('should parse exceptions with native code frames in Edge 44', () => {
const EDGE44_NATIVE_CODE_EXCEPTION = {
message: 'test',
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function constructWebpackConfigFunction(
appDirPath = path.join(projectDir, 'src', 'app');
}

const apiRoutesPath = path.join(pagesDirPath, 'api');
const apiRoutesPath = path.join(pagesDirPath, 'api', '/');

const middlewareJsPath = path.join(pagesDirPath, '..', 'middleware.js');
const middlewareTsPath = path.join(pagesDirPath, '..', 'middleware.ts');
Expand Down
5 changes: 5 additions & 0 deletions packages/nextjs/test/config/loaders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ describe('webpack loaders', () => {
resourcePath: '/Users/Maisey/projects/squirrelChasingSimulator/src/pages/[...testPage].js',
expectedWrappingTargetKind: 'page',
},
// Regression test for https://github.com/getsentry/sentry-javascript/issues/7122
{
resourcePath: '/Users/Maisey/projects/squirrelChasingSimulator/src/pages/apidoc/[version].tsx',
expectedWrappingTargetKind: 'page',
},
{
resourcePath: '/Users/Maisey/projects/squirrelChasingSimulator/src/middleware.js',
expectedWrappingTargetKind: 'middleware',
Expand Down
24 changes: 13 additions & 11 deletions packages/node/src/integrations/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,25 @@ export class Http implements Integration {
// and we will no longer have to do this optional merge, we can just pass `this._tracing` directly.
const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined;

const wrappedHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions);

// eslint-disable-next-line @typescript-eslint/no-var-requires
const httpModule = require('http');
fill(httpModule, 'get', wrappedHandlerMaker);
fill(httpModule, 'request', wrappedHandlerMaker);
const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions, httpModule);
fill(httpModule, 'get', wrappedHttpHandlerMaker);
fill(httpModule, 'request', wrappedHttpHandlerMaker);

// NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
// If we do, we'd get double breadcrumbs and double spans for `https` calls.
// It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.
if (NODE_VERSION.major && NODE_VERSION.major > 8) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const httpsModule = require('https');
fill(httpsModule, 'get', wrappedHandlerMaker);
fill(httpsModule, 'request', wrappedHandlerMaker);
const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(
this._breadcrumbs,
tracingOptions,
httpsModule,
);
fill(httpsModule, 'get', wrappedHttpsHandlerMaker);
fill(httpsModule, 'request', wrappedHttpsHandlerMaker);
}
}
}
Expand All @@ -137,6 +141,7 @@ type WrappedRequestMethodFactory = (original: OriginalRequestMethod) => WrappedR
function _createWrappedRequestMethodFactory(
breadcrumbsEnabled: boolean,
tracingOptions: TracingOptions | undefined,
httpModule: typeof http | typeof https,
): WrappedRequestMethodFactory {
// We're caching results so we don't have to recompute regexp every time we create a request.
const createSpanUrlMap = new LRUMap<string, boolean>(100);
Expand Down Expand Up @@ -172,11 +177,8 @@ function _createWrappedRequestMethodFactory(
};

return function wrappedRequestMethodFactory(originalRequestMethod: OriginalRequestMethod): WrappedRequestMethod {
return function wrappedMethod(this: typeof http | typeof https, ...args: RequestMethodArgs): http.ClientRequest {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const httpModule = this;

const requestArgs = normalizeRequestArgs(this, args);
return function wrappedMethod(this: unknown, ...args: RequestMethodArgs): http.ClientRequest {
const requestArgs = normalizeRequestArgs(httpModule, args);
const requestOptions = requestArgs[0];
const requestUrl = extractUrl(requestOptions);

Expand Down
5 changes: 3 additions & 2 deletions packages/replay/src/util/shouldFilterRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ import { getCurrentHub } from '@sentry/core';
import type { ReplayContainer } from '../types';

/**
* Check whether a given request URL should be filtered out.
* Check whether a given request URL should be filtered out. This is so we
* don't log Sentry ingest requests.
*/
export function shouldFilterRequest(replay: ReplayContainer, url: string): boolean {
// If we enabled the `traceInternals` experiment, we want to trace everything
if (__DEBUG_BUILD__ && replay.getOptions()._experiments.traceInternals) {
return false;
}

return !_isSentryRequest(url);
return _isSentryRequest(url);
}

/**
Expand Down
20 changes: 20 additions & 0 deletions packages/replay/test/integration/shouldFilterRequest.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { shouldFilterRequest } from '../../src/util/shouldFilterRequest';
import { mockSdk } from '../index';

describe('Integration | shouldFilterRequest', () => {
beforeEach(() => {
jest.resetModules();
});

it('should not filter requests from non-Sentry ingest URLs', async () => {
const { replay } = await mockSdk();

expect(shouldFilterRequest(replay, 'https://example.com/foo')).toBe(false);
});

it('should filter requests for Sentry ingest URLs', async () => {
const { replay } = await mockSdk();

expect(shouldFilterRequest(replay, 'https://03031aa.ingest.f00.f00/api/129312/')).toBe(true);
});
});
1 change: 1 addition & 0 deletions packages/tracing/src/index.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export {
export { BrowserClient } from '@sentry/browser';
export {
defaultIntegrations,
defaultStackParser,
forceLoad,
init,
lastEventId,
Expand Down