Skip to content

Commit 1f34b16

Browse files
authored
Merge pull request #7919 from getsentry/prepare-release/7.49.0
meta(changelog): Update CHANGELOG for 7.49.0
2 parents af04395 + 0b65590 commit 1f34b16

File tree

65 files changed

+1637
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1637
-186
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ jobs:
433433
strategy:
434434
fail-fast: false
435435
matrix:
436-
node: [8, 10, 12, 14, 16, 18]
436+
node: [8, 10, 12, 14, 16, 18, 20]
437437
steps:
438438
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
439439
uses: actions/checkout@v3
@@ -698,7 +698,7 @@ jobs:
698698
strategy:
699699
fail-fast: false
700700
matrix:
701-
node: [10, 12, 14, 16, 18]
701+
node: [10, 12, 14, 16, 18, 20]
702702
steps:
703703
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
704704
uses: actions/checkout@v3

.github/workflows/gitflow-sync-develop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040

4141
- name: Enable automerge for PR
4242
run: gh pr merge --merge --auto "1"
43+
env:
44+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4345

4446
# https://github.com/marketplace/actions/auto-approve
4547
- name: Auto approve PR
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Tag issues with last commenter'
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
if: ${{ !github.event.issue.pull_request }}
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Add label if commenter is not member
16+
if: |
17+
github.event.comment.author_association != 'COLLABORATOR'
18+
&& github.event.comment.author_association != 'MEMBER'
19+
&& github.event.comment.author_association != 'OWNER'
20+
uses: actions-ecosystem/action-add-labels@v1
21+
with:
22+
labels: 'Waiting for: Team'
23+
24+
- name: Remove label if commenter is member
25+
if: |
26+
github.event.comment.author_association == 'COLLABORATOR'
27+
|| github.event.comment.author_association == 'MEMBER'
28+
|| github.event.comment.author_association == 'OWNER'
29+
uses: actions-ecosystem/action-remove-labels@v1
30+
with:
31+
labels: 'Waiting for: Team'

CHANGELOG.md

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

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

7+
## 7.49.0
8+
9+
### Important Changes
10+
11+
- **feat(sveltekit): Read adapter output directory from `svelte.config.js` (#7863)**
12+
13+
Our source maps upload plugin is now able to read `svelte.config.js`. This is necessary to automatically find the output directory that users can specify when setting up the Node adapter.
14+
15+
- **fix(replay): Ensure we normalize scope breadcrumbs to max. depth to avoid circular ref (#7915)**
16+
17+
This release fixes a potential problem with how Replay captures console logs.
18+
Any objects logged will now be cut off after a maximum depth of 10, as well as cutting off any properties after the 1000th.
19+
This should ensure we do not accidentally capture massive console logs, where a stringified object could reach 100MB or more.
20+
21+
- **fix(utils): Normalize HTML elements as string (#7916)**
22+
23+
We used to normalize references to HTML elements as POJOs.
24+
This is both not very easily understandable, as well as potentially large, as HTML elements may have properties attached to them.
25+
With this change, we now normalize them to e.g. `[HTMLElement: HTMLInputElement]`.
26+
27+
### Additional Features and Fixes
28+
29+
- feat(browser): Simplify stack parsers (#7897)
30+
- feat(node): Add monitor upsert types (#7914)
31+
- feat(replay): Truncate network bodies to max size (#7875)
32+
- fix(gatsby): Don't crash build when auth token is missing (#7858)
33+
- fix(gatsby): Use `import` for `gatsby-browser.js` instead of `require` (#7889)
34+
- fix(nextjs): Handle braces in stack frame URLs (#7900)
35+
- fix(nextjs): Mark value injection loader result as uncacheable (#7870)
36+
- fix(node): Correct typo in trpc integration transaciton name (#7871)
37+
- fix(node): reduce deepReadDirSync runtime complexity (#7910)
38+
- fix(sveltekit): Avoid capturing "Not Found" errors in server `handleError` wrapper (#7898)
39+
- fix(sveltekit): Detect sentry release before creating the Vite plugins (#7902)
40+
- fix(sveltekit): Use `sentry.properties` file when uploading source maps (#7890)
41+
- fix(tracing): Ensure we use s instead of ms for startTimestamp (#7877)
42+
- ref(deprecate): Deprecate `timestampWithMs` (#7878)
43+
- ref(nextjs): Don't use Sentry Webpack Plugin in dev mode (#7901)
44+
745
## 7.48.0
846

947
### Important Changes
@@ -26,7 +64,7 @@ import * as Sentry from '@sentry/node';
2664
const requestHandler = (ctx, next) => {
2765
return new Promise((resolve, reject) => {
2866
Sentry.runWithAsyncContext(async () => {
29-
const hub = Sentry.geCurrentHub();
67+
const hub = Sentry.getCurrentHub();
3068

3169
hub.configureScope(scope =>
3270
scope.addEventProcessor(event =>
@@ -38,7 +76,11 @@ const requestHandler = (ctx, next) => {
3876
)
3977
);
4078

41-
await next();
79+
try {
80+
await next();
81+
} catch (err) {
82+
reject(err);
83+
}
4284
resolve();
4385
});
4486
});

MIGRATION.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Deprecations in 7.x
22

3+
## Deprecate `timestampWithMs` export - #7878
4+
5+
The `timestampWithMs` util is deprecated in favor of using `timestampInSeconds`.
6+
37
## Remove requirement for `@sentry/tracing` package (since 7.46.0)
48

59
With `7.46.0` you no longer require the `@sentry/tracing` package to use tracing and performance monitoring with the Sentry JavaScript SDKs. The `@sentry/tracing` package will be removed in a future major release, but can still be used in the meantime.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"postpublish": "lerna run --stream --concurrency 1 postpublish",
2828
"test": "lerna run --ignore @sentry-internal/* test",
2929
"test:unit": "lerna run --ignore @sentry-internal/* test:unit",
30-
"test-ci-browser": "lerna run test --ignore \"@sentry/{node,opentelemetry-node,serverless,nextjs,remix,gatsby}\" --ignore @sentry-internal/*",
30+
"test-ci-browser": "lerna run test --ignore \"@sentry/{node,opentelemetry-node,serverless,nextjs,remix,gatsby,sveltekit}\" --ignore @sentry-internal/*",
3131
"test-ci-node": "ts-node ./scripts/node-unit-tests.ts",
3232
"test:update-snapshots": "lerna run test:update-snapshots",
3333
"yalc:publish": "lerna run yalc:publish"

packages/angular/src/tracing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Router } from '@angular/router';
1010
import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';
1111
import { getCurrentHub, WINDOW } from '@sentry/browser';
1212
import type { Span, Transaction, TransactionContext } from '@sentry/types';
13-
import { logger, stripUrlQueryAndFragment, timestampWithMs } from '@sentry/utils';
13+
import { logger, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils';
1414
import type { Observable } from 'rxjs';
1515
import { Subscription } from 'rxjs';
1616
import { filter, tap } from 'rxjs/operators';
@@ -258,7 +258,7 @@ export function TraceMethodDecorator(): MethodDecorator {
258258
const originalMethod = descriptor.value;
259259
// eslint-disable-next-line @typescript-eslint/no-explicit-any
260260
descriptor.value = function (...args: any[]): ReturnType<typeof originalMethod> {
261-
const now = timestampWithMs();
261+
const now = timestampInSeconds();
262262
const activeTransaction = getActiveTransaction();
263263
if (activeTransaction) {
264264
activeTransaction.startChild({

packages/browser-integration-tests/suites/public-api/setContext/non_serializable_context/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ sentryTest('should normalize non-serializable context', async ({ getLocalTestPat
99

1010
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
1111

12-
expect(eventData.contexts?.non_serializable).toMatchObject({});
12+
expect(eventData.contexts?.non_serializable).toEqual('[HTMLElement: HTMLBodyElement]');
1313
expect(eventData.message).toBe('non_serializable');
1414
});

packages/browser/src/stack-parsers.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function createFrame(filename: string, func: string, lineno?: number, colno?: nu
5555

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

6161
const chrome: StackLineParserFn = line => {
@@ -91,7 +91,7 @@ export const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chrome];
9191
// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
9292
// We need this specific case for now because we want no other regex to match.
9393
const geckoREgex =
94-
/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
94+
/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
9595
const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
9696

9797
const gecko: StackLineParserFn = line => {
@@ -123,8 +123,7 @@ const gecko: StackLineParserFn = line => {
123123

124124
export const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];
125125

126-
const winjsRegex =
127-
/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
126+
const winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
128127

129128
const winjs: StackLineParserFn = line => {
130129
const parts = winjsRegex.exec(line);

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,41 @@ describe('Tracekit - Chrome Tests', () => {
573573
});
574574
});
575575

576+
it('handles braces in urls', () => {
577+
const CHROME_BRACES_URL = {
578+
message: 'bad',
579+
name: 'Error',
580+
stack: `Error: bad
581+
at something (http://localhost:5000/(some)/(thing)/index.html:20:16)
582+
at more (http://localhost:5000/(some)/(thing)/index.html:25:7)`,
583+
};
584+
585+
const ex = exceptionFromError(parser, CHROME_BRACES_URL);
586+
587+
expect(ex).toEqual({
588+
value: 'bad',
589+
type: 'Error',
590+
stacktrace: {
591+
frames: [
592+
{
593+
filename: 'http://localhost:5000/(some)/(thing)/index.html',
594+
function: 'more',
595+
lineno: 25,
596+
colno: 7,
597+
in_app: true,
598+
},
599+
{
600+
filename: 'http://localhost:5000/(some)/(thing)/index.html',
601+
function: 'something',
602+
lineno: 20,
603+
colno: 16,
604+
in_app: true,
605+
},
606+
],
607+
},
608+
});
609+
});
610+
576611
it('should drop frames that are over 1kb', () => {
577612
const LONG_STR = 'A'.repeat(1040);
578613

packages/core/src/tracing/idletransaction.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable max-lines */
22
import type { TransactionContext } from '@sentry/types';
3-
import { logger, timestampWithMs } from '@sentry/utils';
3+
import { logger, timestampInSeconds } from '@sentry/utils';
44

55
import type { Hub } from '../hub';
66
import type { Span } from './span';
@@ -46,7 +46,7 @@ export class IdleTransactionSpanRecorder extends SpanRecorder {
4646
if (span.spanId !== this.transactionSpanId) {
4747
// We patch span.finish() to pop an activity after setting an endTimestamp.
4848
span.finish = (endTimestamp?: number) => {
49-
span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();
49+
span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampInSeconds();
5050
this._popActivity(span.spanId);
5151
};
5252

@@ -128,7 +128,7 @@ export class IdleTransaction extends Transaction {
128128
}
129129

130130
/** {@inheritDoc} */
131-
public finish(endTimestamp: number = timestampWithMs()): string | undefined {
131+
public finish(endTimestamp: number = timestampInSeconds()): string | undefined {
132132
this._finished = true;
133133
this.activities = {};
134134

@@ -301,13 +301,13 @@ export class IdleTransaction extends Transaction {
301301
}
302302

303303
if (Object.keys(this.activities).length === 0) {
304-
const endTimestamp = timestampWithMs();
304+
const endTimestamp = timestampInSeconds();
305305
if (this._idleTimeoutCanceledPermanently) {
306306
this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];
307307
this.finish(endTimestamp);
308308
} else {
309309
// We need to add the timeout here to have the real endtimestamp of the transaction
310-
// Remember timestampWithMs is in seconds, timeout is in ms
310+
// Remember timestampInSeconds is in seconds, timeout is in ms
311311
this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);
312312
}
313313
}

packages/core/src/tracing/span.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
TraceContext,
88
Transaction,
99
} from '@sentry/types';
10-
import { dropUndefinedKeys, logger, timestampWithMs, uuid4 } from '@sentry/utils';
10+
import { dropUndefinedKeys, logger, timestampInSeconds, uuid4 } from '@sentry/utils';
1111

1212
/**
1313
* Keeps track of finished spans for a given transaction
@@ -71,7 +71,7 @@ export class Span implements SpanInterface {
7171
/**
7272
* Timestamp in seconds when the span was created.
7373
*/
74-
public startTimestamp: number = timestampWithMs();
74+
public startTimestamp: number = timestampInSeconds();
7575

7676
/**
7777
* Timestamp in seconds when the span ended.
@@ -257,7 +257,7 @@ export class Span implements SpanInterface {
257257
}
258258
}
259259

260-
this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();
260+
this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampInSeconds();
261261
}
262262

263263
/**

packages/ember/addon/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { macroCondition, isDevelopingApp, getOwnConfig } from '@embroider/macros
44
import { next } from '@ember/runloop';
55
import { assert, warn } from '@ember/debug';
66
import Ember from 'ember';
7-
import { timestampWithMs, GLOBAL_OBJ } from '@sentry/utils';
7+
import { timestampInSeconds, GLOBAL_OBJ } from '@sentry/utils';
88
import { GlobalConfig, OwnConfig } from './types';
99

1010
function _getSentryInitConfig() {
@@ -68,7 +68,7 @@ export const getActiveTransaction = () => {
6868

6969
export const instrumentRoutePerformance = (BaseRoute: any) => {
7070
const instrumentFunction = async (op: string, description: string, fn: Function, args: any) => {
71-
const startTimestamp = timestampWithMs();
71+
const startTimestamp = timestampInSeconds();
7272
const result = await fn(...args);
7373

7474
const currentTransaction = getActiveTransaction();

packages/ember/addon/instance-initializers/sentry-performance.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ExtendedBackburner } from '@sentry/ember/runloop';
66
import { Span, Transaction } from '@sentry/types';
77
import { EmberRunQueues } from '@ember/runloop/-private/types';
88
import { getActiveTransaction } from '..';
9-
import { browserPerformanceTimeOrigin, GLOBAL_OBJ, timestampWithMs } from '@sentry/utils';
9+
import { browserPerformanceTimeOrigin, GLOBAL_OBJ, timestampInSeconds } from '@sentry/utils';
1010
import { macroCondition, isTesting, getOwnConfig } from '@embroider/macros';
1111
import { EmberSentryConfig, GlobalConfig, OwnConfig } from '../types';
1212
import RouterService from '@ember/routing/router-service';
@@ -182,14 +182,14 @@ function _instrumentEmberRunloop(config: EmberSentryConfig) {
182182
if (currentQueueSpan) {
183183
currentQueueSpan.finish();
184184
}
185-
currentQueueStart = timestampWithMs();
185+
currentQueueStart = timestampInSeconds();
186186

187187
instrumentedEmberQueues.forEach(queue => {
188188
scheduleOnce(queue, null, () => {
189189
scheduleOnce(queue, null, () => {
190190
// Process this queue using the end of the previous queue.
191191
if (currentQueueStart) {
192-
const now = timestampWithMs();
192+
const now = timestampInSeconds();
193193
const minQueueDuration = minimumRunloopQueueDuration ?? 5;
194194

195195
if ((now - currentQueueStart) * 1000 >= minQueueDuration) {
@@ -210,7 +210,7 @@ function _instrumentEmberRunloop(config: EmberSentryConfig) {
210210
if (!stillActiveTransaction) {
211211
return;
212212
}
213-
currentQueueStart = timestampWithMs();
213+
currentQueueStart = timestampInSeconds();
214214
});
215215
});
216216
});
@@ -244,7 +244,7 @@ interface RenderEntries {
244244
function processComponentRenderBefore(payload: Payload, beforeEntries: RenderEntries) {
245245
const info = {
246246
payload,
247-
now: timestampWithMs(),
247+
now: timestampInSeconds(),
248248
};
249249
beforeEntries[payload.object] = info;
250250
}
@@ -261,7 +261,7 @@ function processComponentRenderAfter(
261261
return;
262262
}
263263

264-
const now = timestampWithMs();
264+
const now = timestampInSeconds();
265265
const componentRenderDuration = now - begin.now;
266266

267267
if (componentRenderDuration * 1000 >= minComponentDuration) {

packages/gatsby/.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ module.exports = {
1515
project: ['../../tsconfig.dev.json'],
1616
},
1717
},
18+
{
19+
files: ['./gatsby-browser.js'],
20+
env: {
21+
browser: true,
22+
node: false,
23+
},
24+
parserOptions: {
25+
sourceType: 'module',
26+
},
27+
},
1828
],
1929
extends: ['../../.eslintrc.js'],
2030
};

0 commit comments

Comments
 (0)