Skip to content

Commit f271796

Browse files
authored
Merge pull request #7142 from getsentry/prepare-release/7.37.1
meta: Update changelog for 7.37.1
2 parents e6ce43b + 3098d54 commit f271796

File tree

10 files changed

+79
-17
lines changed

10 files changed

+79
-17
lines changed

.github/workflows/auto-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
with:
2525
# Parse version from head branch
2626
text: ${{ github.head_ref }}
27-
# match: refs/heads/preprare-release/xx.xx.xx
28-
regex: '^refs\/heads\/preprare-release\/(\d+\.\d+\.\d+)$'
27+
# match: preprare-release/xx.xx.xx
28+
regex: '^preprare-release\/(\d+\.\d+\.\d+)$'
2929

3030
- name: Prepare release
3131
uses: getsentry/action-prepare-release@v1

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

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

7+
## 7.31.1
8+
9+
- fix(browser): Support `async` in stack frame urls (#7131)
10+
- fix(nextjs): Make api route identifier stricter (#7126)
11+
- fix(node): Don't rely on `this` in http integration (#7135)
12+
- fix(replay): Fix missing fetch/xhr requests (#7134)
13+
- fix(tracing): Export `defaultStackParser` from tracing CDN bundles (#7116)
14+
715
## 7.37.0
816

917
- feat: Add source map debug ids (#7068)

packages/browser/src/stack-parsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function createFrame(filename: string, func: string, lineno?: number, colno?: nu
3131

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

3737
const chrome: StackLineParserFn = line => {

packages/browser/test/unit/tracekit/chromium.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,31 @@ describe('Tracekit - Chrome Tests', () => {
332332
});
333333
});
334334

335+
it('should parse frames with async urls', () => {
336+
const CHROME_109_ASYNC_URL = {
337+
message: 'bad',
338+
name: 'Error',
339+
stack: `Error: bad
340+
at callAnotherThing (http://localhost:5000/:20:16)
341+
at Object.callback (async http://localhost:5000/:25:7)
342+
at test (http://localhost:5000/:33:23)`,
343+
};
344+
345+
const ex = exceptionFromError(parser, CHROME_109_ASYNC_URL);
346+
347+
expect(ex).toEqual({
348+
value: 'bad',
349+
type: 'Error',
350+
stacktrace: {
351+
frames: [
352+
{ filename: 'http://localhost:5000/', function: 'test', lineno: 33, colno: 23, in_app: true },
353+
{ filename: 'http://localhost:5000/', function: 'Object.callback', lineno: 25, colno: 7, in_app: true },
354+
{ filename: 'http://localhost:5000/', function: 'callAnotherThing', lineno: 20, colno: 16, in_app: true },
355+
],
356+
},
357+
});
358+
});
359+
335360
it('should parse exceptions with native code frames in Edge 44', () => {
336361
const EDGE44_NATIVE_CODE_EXCEPTION = {
337362
message: 'test',

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function constructWebpackConfigFunction(
9696
appDirPath = path.join(projectDir, 'src', 'app');
9797
}
9898

99-
const apiRoutesPath = path.join(pagesDirPath, 'api');
99+
const apiRoutesPath = path.join(pagesDirPath, 'api', '/');
100100

101101
const middlewareJsPath = path.join(pagesDirPath, '..', 'middleware.js');
102102
const middlewareTsPath = path.join(pagesDirPath, '..', 'middleware.ts');

packages/nextjs/test/config/loaders.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ describe('webpack loaders', () => {
118118
resourcePath: '/Users/Maisey/projects/squirrelChasingSimulator/src/pages/[...testPage].js',
119119
expectedWrappingTargetKind: 'page',
120120
},
121+
// Regression test for https://github.com/getsentry/sentry-javascript/issues/7122
122+
{
123+
resourcePath: '/Users/Maisey/projects/squirrelChasingSimulator/src/pages/apidoc/[version].tsx',
124+
expectedWrappingTargetKind: 'page',
125+
},
121126
{
122127
resourcePath: '/Users/Maisey/projects/squirrelChasingSimulator/src/middleware.js',
123128
expectedWrappingTargetKind: 'middleware',

packages/node/src/integrations/http.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,25 @@ export class Http implements Integration {
101101
// and we will no longer have to do this optional merge, we can just pass `this._tracing` directly.
102102
const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined;
103103

104-
const wrappedHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions);
105-
106104
// eslint-disable-next-line @typescript-eslint/no-var-requires
107105
const httpModule = require('http');
108-
fill(httpModule, 'get', wrappedHandlerMaker);
109-
fill(httpModule, 'request', wrappedHandlerMaker);
106+
const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions, httpModule);
107+
fill(httpModule, 'get', wrappedHttpHandlerMaker);
108+
fill(httpModule, 'request', wrappedHttpHandlerMaker);
110109

111110
// NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
112111
// If we do, we'd get double breadcrumbs and double spans for `https` calls.
113112
// It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.
114113
if (NODE_VERSION.major && NODE_VERSION.major > 8) {
115114
// eslint-disable-next-line @typescript-eslint/no-var-requires
116115
const httpsModule = require('https');
117-
fill(httpsModule, 'get', wrappedHandlerMaker);
118-
fill(httpsModule, 'request', wrappedHandlerMaker);
116+
const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(
117+
this._breadcrumbs,
118+
tracingOptions,
119+
httpsModule,
120+
);
121+
fill(httpsModule, 'get', wrappedHttpsHandlerMaker);
122+
fill(httpsModule, 'request', wrappedHttpsHandlerMaker);
119123
}
120124
}
121125
}
@@ -137,6 +141,7 @@ type WrappedRequestMethodFactory = (original: OriginalRequestMethod) => WrappedR
137141
function _createWrappedRequestMethodFactory(
138142
breadcrumbsEnabled: boolean,
139143
tracingOptions: TracingOptions | undefined,
144+
httpModule: typeof http | typeof https,
140145
): WrappedRequestMethodFactory {
141146
// We're caching results so we don't have to recompute regexp every time we create a request.
142147
const createSpanUrlMap = new LRUMap<string, boolean>(100);
@@ -172,11 +177,8 @@ function _createWrappedRequestMethodFactory(
172177
};
173178

174179
return function wrappedRequestMethodFactory(originalRequestMethod: OriginalRequestMethod): WrappedRequestMethod {
175-
return function wrappedMethod(this: typeof http | typeof https, ...args: RequestMethodArgs): http.ClientRequest {
176-
// eslint-disable-next-line @typescript-eslint/no-this-alias
177-
const httpModule = this;
178-
179-
const requestArgs = normalizeRequestArgs(this, args);
180+
return function wrappedMethod(this: unknown, ...args: RequestMethodArgs): http.ClientRequest {
181+
const requestArgs = normalizeRequestArgs(httpModule, args);
180182
const requestOptions = requestArgs[0];
181183
const requestUrl = extractUrl(requestOptions);
182184

packages/replay/src/util/shouldFilterRequest.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import { getCurrentHub } from '@sentry/core';
33
import type { ReplayContainer } from '../types';
44

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

14-
return !_isSentryRequest(url);
15+
return _isSentryRequest(url);
1516
}
1617

1718
/**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { shouldFilterRequest } from '../../src/util/shouldFilterRequest';
2+
import { mockSdk } from '../index';
3+
4+
describe('Integration | shouldFilterRequest', () => {
5+
beforeEach(() => {
6+
jest.resetModules();
7+
});
8+
9+
it('should not filter requests from non-Sentry ingest URLs', async () => {
10+
const { replay } = await mockSdk();
11+
12+
expect(shouldFilterRequest(replay, 'https://example.com/foo')).toBe(false);
13+
});
14+
15+
it('should filter requests for Sentry ingest URLs', async () => {
16+
const { replay } = await mockSdk();
17+
18+
expect(shouldFilterRequest(replay, 'https://03031aa.ingest.f00.f00/api/129312/')).toBe(true);
19+
});
20+
});

packages/tracing/src/index.bundle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export {
4141
export { BrowserClient } from '@sentry/browser';
4242
export {
4343
defaultIntegrations,
44+
defaultStackParser,
4445
forceLoad,
4546
init,
4647
lastEventId,

0 commit comments

Comments
 (0)