Skip to content

Commit f874586

Browse files
authored
Merge pull request #8417 from getsentry/prepare-release/7.57.0
meta(changelog): Update Changelog for 7.57.0
2 parents 6afd3e0 + 4d87498 commit f874586

File tree

268 files changed

+3342
-2237
lines changed

Some content is hidden

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

268 files changed

+3342
-2237
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
- 'scripts/**'
9090
- 'packages/core/**'
9191
- 'packages/tracing/**'
92+
- 'packages/tracing-internal/**'
9293
- 'packages/utils/**'
9394
- 'packages/types/**'
9495
- 'packages/integrations/**'
@@ -424,7 +425,7 @@ jobs:
424425
name: Nextjs (Node ${{ matrix.node }}) Tests
425426
needs: [job_get_metadata, job_build]
426427
if: needs.job_get_metadata.outputs.changed_nextjs == 'true' || github.event_name != 'pull_request'
427-
timeout-minutes: 15
428+
timeout-minutes: 25
428429
runs-on: ubuntu-20.04
429430
strategy:
430431
fail-fast: false
@@ -654,7 +655,9 @@ jobs:
654655
yarn test:package
655656
656657
job_node_integration_tests:
657-
name: Node (${{ matrix.node }}) Integration Tests
658+
name:
659+
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }} Integration
660+
Tests
658661
needs: [job_get_metadata, job_build]
659662
if: needs.job_get_metadata.outputs.changed_node == 'true' || github.event_name != 'pull_request'
660663
runs-on: ubuntu-20.04
@@ -663,6 +666,12 @@ jobs:
663666
fail-fast: false
664667
matrix:
665668
node: [10, 12, 14, 16, 18, 20]
669+
typescript:
670+
- false
671+
include:
672+
# Only check typescript for latest version (to streamline CI)
673+
- node: 20
674+
typescript: '3.8'
666675
steps:
667676
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
668677
uses: actions/checkout@v3
@@ -676,6 +685,11 @@ jobs:
676685
uses: ./.github/actions/restore-cache
677686
env:
678687
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
688+
689+
- name: Overwrite typescript version
690+
if: matrix.typescript
691+
run: yarn add --dev --ignore-workspace-root-check typescript@${{ matrix.typescript }}
692+
679693
- name: Run integration tests
680694
env:
681695
NODE_VERSION: ${{ matrix.node }}
@@ -684,7 +698,7 @@ jobs:
684698
yarn test
685699
686700
job_remix_integration_tests:
687-
name: Remix (Node ${{ matrix.node }}) Tests
701+
name: Remix v${{ matrix.remix }} (Node ${{ matrix.node }}) Tests
688702
needs: [job_get_metadata, job_build]
689703
if: needs.job_get_metadata.outputs.changed_remix == 'true' || github.event_name != 'pull_request'
690704
runs-on: ubuntu-20.04
@@ -693,6 +707,7 @@ jobs:
693707
fail-fast: false
694708
matrix:
695709
node: [14, 16, 18]
710+
remix: [1, 2]
696711
steps:
697712
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
698713
uses: actions/checkout@v3
@@ -709,12 +724,13 @@ jobs:
709724
- name: Run integration tests
710725
env:
711726
NODE_VERSION: ${{ matrix.node }}
727+
REMIX_VERSION: ${{ matrix.remix }}
712728
run: |
713729
cd packages/remix
714730
yarn test:integration:ci
715731
716732
job_e2e_tests:
717-
name: E2E Tests (Shard ${{ matrix.shard }})
733+
name: E2E (Shard ${{ matrix.shard }}) Tests
718734
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
719735
# Dependabot PRs sadly also don't have access to secrets, so we skip them as well
720736
if:
@@ -727,6 +743,7 @@ jobs:
727743
fail-fast: false
728744
matrix:
729745
shard: [1, 2, 3]
746+
730747
steps:
731748
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
732749
uses: actions/checkout@v3
@@ -743,6 +760,7 @@ jobs:
743760
uses: ./.github/actions/restore-cache
744761
env:
745762
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
763+
746764
- name: Get node version
747765
id: versions
748766
run: |

CHANGELOG.md

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

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

7+
## 7.57.0
8+
9+
### Important Changes
10+
11+
- **build: Update typescript from 3.8.3 to 4.9.5 (#8255)**
12+
13+
This release version [bumps the internally used typescript version from 3.8.x to 4.9.x](https://github.com/getsentry/sentry-javascript/pull/8255).
14+
We use ds-downlevel to generate two versions of our types, one for >=3.8, one for >=4.9.
15+
This means that this change should be fully backwards compatible and not have any noticable user impact,
16+
but if you still encounter issues please let us know.
17+
18+
- **feat(types): Add tracePropagationTargets to top level options (#8395)**
19+
20+
Instead of passing `tracePropagationTargets` to the `BrowserTracing` integration, you can now define them on the top level:
21+
22+
```js
23+
Sentry.init({
24+
tracePropagationTargets: ['api.site.com'],
25+
});
26+
```
27+
28+
- **fix(angular): Filter out `TryCatch` integration by default (#8367)**
29+
30+
The Angular and Angular-ivy SDKs will not install the TryCatch integration anymore by default.
31+
This integration conflicted with the `SentryErrorHander`, sometimes leading to duplicated errors and/or missing data on events.
32+
33+
- **feat(browser): Better event name handling for non-Error objects (#8374)**
34+
35+
When capturing non-errors via `Sentry.captureException()`, e.g. `Sentry.captureException({ prop: "custom object" })`,
36+
we now generate a more helpful value for the synthetic exception. Instead of e.g. `Non-Error exception captured with keys: currentTarget, isTrusted, target, type`, you'll now get messages like:
37+
38+
```
39+
Object captured as exception with keys: prop1, prop2
40+
Event `MouseEvent` (type=click) captured as exception
41+
Event `ErrorEvent` captured as exception with message `Script error.`
42+
```
43+
44+
### Other Changes
45+
46+
- feat(browser): Send profiles in same envelope as transactions (#8375)
47+
- feat(profiling): Collect timings on profiler stop calls (#8409)
48+
- feat(replay): Do not capture replays < 5 seconds (GA) (#8277)
49+
- feat(tracing): Add experiment to capture http timings (#8371)
50+
- feat(tracing): Add `http.response.status_code` to `span.data` (#8366)
51+
- fix(angular): Stop routing spans on navigation cancel and error events (#8369)
52+
- fix(core): Only start spans in `trace` if tracing is enabled (#8357)
53+
- fix(nextjs): Inject init calls via loader instead of via entrypoints (#8368)
54+
- fix(replay): Mark ui.slowClickDetected `clickCount` as optional (#8376)
55+
- fix(serverless): Export `autoDiscoverNodePerformanceMonitoringIntegrations` from SDK (#8382)
56+
- fix(sveltekit): Check for cached requests in client-side fetch instrumentation (#8391)
57+
- fix(sveltekit): Only instrument SvelteKit `fetch` if the SDK client is valid (#8381)
58+
- fix(tracing): Instrument Prisma client in constructor of integration (#8383)
59+
- ref(replay): More graceful `sessionStorage` check (#8394)
60+
- ref(replay): Remove circular dep in replay eventBuffer (#8389)
61+
762
## 7.56.0
863

964
- feat(replay): Rework slow click & multi click detection (#8322)

nx.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
],
6565
"outputs": [
6666
"{projectRoot}/build/types",
67-
"{projectRoot}/build/npm/types"
67+
"{projectRoot}/build/types-ts3.8",
68+
"{projectRoot}/build/npm/types",
69+
"{projectRoot}/build/npm/types-ts3.8"
6870
]
6971
},
7072
"lint:eslint": {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"chai": "^4.1.2",
9191
"codecov": "^3.6.5",
9292
"deepmerge": "^4.2.2",
93+
"downlevel-dts": "~0.11.0",
9394
"es-check": "7.1.0",
9495
"eslint": "7.32.0",
9596
"jest": "^27.5.1",
@@ -114,9 +115,9 @@
114115
"size-limit": "^4.5.5",
115116
"ts-jest": "^27.1.4",
116117
"ts-node": "10.9.1",
117-
"tslib": "^2.3.1",
118+
"tslib": "2.4.1",
118119
"typedoc": "^0.18.0",
119-
"typescript": "3.8.3",
120+
"typescript": "4.9.5",
120121
"vitest": "^0.29.2",
121122
"yalc": "^1.0.0-pre.53"
122123
},

packages/angular-ivy/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@sentry/browser": "7.56.0",
2525
"@sentry/types": "7.56.0",
2626
"@sentry/utils": "7.56.0",
27-
"tslib": "^2.3.0"
27+
"tslib": "^2.4.1"
2828
},
2929
"devDependencies": {
3030
"@angular-devkit/build-angular": "~12.2.18",
@@ -37,7 +37,6 @@
3737
"@angular/platform-browser-dynamic": "~12.2.0",
3838
"@angular/router": "~12.2.0",
3939
"ng-packagr": "^12.1.1",
40-
"typescript": "~4.3.5",
4140
"zone.js": "~0.11.4"
4241
},
4342
"scripts": {

packages/angular-ivy/src/sdk.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { VERSION } from '@angular/core';
22
import type { BrowserOptions } from '@sentry/browser';
3-
import { init as browserInit, SDK_VERSION, setContext } from '@sentry/browser';
3+
import { defaultIntegrations, init as browserInit, SDK_VERSION, setContext } from '@sentry/browser';
44
import { logger } from '@sentry/utils';
55

66
import { IS_DEBUG_BUILD } from './flags';
@@ -21,6 +21,18 @@ export function init(options: BrowserOptions): void {
2121
version: SDK_VERSION,
2222
};
2323

24+
// Filter out TryCatch integration as it interferes with our Angular `ErrorHandler`:
25+
// TryCatch would catch certain errors before they reach the `ErrorHandler` and thus provide a
26+
// lower fidelity error than what `SentryErrorHandler` (see errorhandler.ts) would provide.
27+
// see:
28+
// - https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1453407097
29+
// - https://github.com/getsentry/sentry-javascript/issues/2744
30+
if (options.defaultIntegrations === undefined) {
31+
options.defaultIntegrations = defaultIntegrations.filter(integration => {
32+
return integration.name !== 'TryCatch';
33+
});
34+
}
35+
2436
checkAndSetAngularVersion();
2537
browserInit(options);
2638
}

packages/angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@sentry/browser": "7.56.0",
2525
"@sentry/types": "7.56.0",
2626
"@sentry/utils": "7.56.0",
27-
"tslib": "^2.0.0"
27+
"tslib": "^2.4.1"
2828
},
2929
"devDependencies": {
3030
"@angular-devkit/build-angular": "~0.1002.4",
@@ -38,7 +38,7 @@
3838
"@angular/router": "~10.2.5",
3939
"ng-packagr": "^10.1.0",
4040
"rxjs": "6.5.5",
41-
"typescript": "~4.0.2",
41+
"typescript": "4.0.2",
4242
"zone.js": "^0.11.8"
4343
},
4444
"scripts": {

packages/angular/src/errorhandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http';
22
import type { ErrorHandler as AngularErrorHandler } from '@angular/core';
33
import { Inject, Injectable } from '@angular/core';
44
import * as Sentry from '@sentry/browser';
5-
import { captureException } from '@sentry/browser';
5+
import type { Event, Scope } from '@sentry/types';
66
import { addExceptionMechanism, isString } from '@sentry/utils';
77

88
import { runOutsideAngular } from './zone';
@@ -101,7 +101,7 @@ class SentryErrorHandler implements AngularErrorHandler {
101101

102102
// Capture handled exception and send it to Sentry.
103103
const eventId = runOutsideAngular(() =>
104-
captureException(extractedError, scope => {
104+
Sentry.captureException(extractedError, (scope: Scope) => {
105105
scope.addEventProcessor(event => {
106106
addExceptionMechanism(event, {
107107
type: 'angular',
@@ -126,7 +126,7 @@ class SentryErrorHandler implements AngularErrorHandler {
126126
const client = Sentry.getCurrentHub().getClient();
127127

128128
if (client && client.on && !this._registeredAfterSendEventHandler) {
129-
client.on('afterSendEvent', event => {
129+
client.on('afterSendEvent', (event: Event) => {
130130
if (!event.type) {
131131
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });
132132
}

packages/angular/src/sdk.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { VERSION } from '@angular/core';
22
import type { BrowserOptions } from '@sentry/browser';
3-
import { init as browserInit, SDK_VERSION, setContext } from '@sentry/browser';
3+
import { defaultIntegrations, init as browserInit, SDK_VERSION, setContext } from '@sentry/browser';
44
import { logger } from '@sentry/utils';
55

66
import { IS_DEBUG_BUILD } from './flags';
@@ -21,6 +21,18 @@ export function init(options: BrowserOptions): void {
2121
version: SDK_VERSION,
2222
};
2323

24+
// Filter out TryCatch integration as it interferes with our Angular `ErrorHandler`:
25+
// TryCatch would catch certain errors before they reach the `ErrorHandler` and thus provide a
26+
// lower fidelity error than what `SentryErrorHandler` (see errorhandler.ts) would provide.
27+
// see:
28+
// - https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1453407097
29+
// - https://github.com/getsentry/sentry-javascript/issues/2744
30+
if (options.defaultIntegrations === undefined) {
31+
options.defaultIntegrations = defaultIntegrations.filter(integration => {
32+
return integration.name !== 'TryCatch';
33+
});
34+
}
35+
2436
checkAndSetAngularVersion();
2537
browserInit(options);
2638
}

packages/angular/src/tracing.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router
55
// Duplicated import to work around a TypeScript bug where it'd complain that `Router` isn't imported as a type.
66
// We need to import it as a value to satisfy Angular dependency injection. So:
77
// eslint-disable-next-line @typescript-eslint/consistent-type-imports, import/no-duplicates
8-
import { Router } from '@angular/router';
8+
import { NavigationCancel, NavigationError, Router } from '@angular/router';
99
// eslint-disable-next-line import/no-duplicates
1010
import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';
1111
import { getCurrentHub, WINDOW } from '@sentry/browser';
@@ -131,7 +131,9 @@ export class TraceService implements OnDestroy {
131131
);
132132

133133
public navEnd$: Observable<Event> = this._router.events.pipe(
134-
filter(event => event instanceof NavigationEnd),
134+
filter(
135+
event => event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError,
136+
),
135137
tap(() => {
136138
if (this._routingSpan) {
137139
runOutsideAngular(() => {

packages/angular/test/errorhandler.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('SentryErrorHandler', () => {
5757
describe('handleError method', () => {
5858
it('handleError method assigns the correct mechanism', () => {
5959
const addEventProcessorSpy = jest.spyOn(FakeScope, 'addEventProcessor').mockImplementationOnce(callback => {
60-
void callback({}, { event_id: 'fake-event-id' });
60+
void (callback as (event: any, hint: any) => void)({}, { event_id: 'fake-event-id' });
6161
return FakeScope;
6262
});
6363

packages/angular/test/sdk.test.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as SentryBrowser from '@sentry/browser';
22

3-
import { init } from '../src/sdk';
3+
import { defaultIntegrations, init } from '../src/index';
44

55
describe('init', () => {
66
it('sets the Angular version (if available) in the global scope', () => {
@@ -13,4 +13,33 @@ describe('init', () => {
1313
expect(setContextSpy).toHaveBeenCalledTimes(1);
1414
expect(setContextSpy).toHaveBeenCalledWith('angular', { version: 10 });
1515
});
16+
17+
describe('filtering out the `TryCatch` integration', () => {
18+
const browserInitSpy = jest.spyOn(SentryBrowser, 'init');
19+
20+
beforeEach(() => {
21+
browserInitSpy.mockClear();
22+
});
23+
24+
it('filters if `defaultIntegrations` is not set', () => {
25+
init({});
26+
27+
expect(browserInitSpy).toHaveBeenCalledTimes(1);
28+
29+
const options = browserInitSpy.mock.calls[0][0] || {};
30+
expect(options.defaultIntegrations).not.toContainEqual(expect.objectContaining({ name: 'TryCatch' }));
31+
});
32+
33+
it.each([false as const, defaultIntegrations])(
34+
"doesn't filter if `defaultIntegrations` is set to %s",
35+
defaultIntegrations => {
36+
init({ defaultIntegrations });
37+
38+
expect(browserInitSpy).toHaveBeenCalledTimes(1);
39+
40+
const options = browserInitSpy.mock.calls[0][0] || {};
41+
expect(options.defaultIntegrations).toEqual(defaultIntegrations);
42+
},
43+
);
44+
});
1645
});

0 commit comments

Comments
 (0)