Skip to content

Commit

Permalink
Merge pull request #9118 from getsentry/prepare-release/7.72.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored and c298lee committed Sep 27, 2023
2 parents 7614bb9 + 7f1f5d7 commit a0c2a88
Show file tree
Hide file tree
Showing 124 changed files with 2,828 additions and 703 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,55 @@

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

## 7.72.0

### Important Changes

- **feat(node): App Not Responding with stack traces (#9079)**

This release introduces support for Application Not Responding (ANR) errors for Node.js applications.
These errors are triggered when the Node.js main thread event loop of an application is blocked for more than five seconds.
The Node SDK reports ANR errors as Sentry events and can optionally attach a stacktrace of the blocking code to the ANR event.

To enable ANR detection, import and use the `enableANRDetection` function from the `@sentry/node` package before you run the rest of your application code.
Any event loop blocking before calling `enableANRDetection` will not be detected by the SDK.

Example (ESM):

```ts
import * as Sentry from "@sentry/node";

Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
});

await Sentry.enableANRDetection({ captureStackTrace: true });
// Function that runs your app
runApp();
```

Example (CJS):

```ts
const Sentry = require("@sentry/node");

Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
});

Sentry.enableANRDetection({ captureStackTrace: true }).then(() => {
// Function that runs your app
runApp();
});
```

### Other Changes

- fix(nextjs): Filter `RequestAsyncStorage` locations by locations that webpack will resolve (#9114)
- fix(replay): Ensure `replay_id` is not captured when session is expired (#9109)

## 7.71.0

- feat(bun): Instrument Bun.serve (#9080)
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "7.71.0",
"version": "7.72.0",
"npmClient": "yarn"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"packages/ember",
"packages/eslint-config-sdk",
"packages/eslint-plugin-sdk",
"packages/feedback",
"packages/gatsby",
"packages/hub",
"packages/integrations",
Expand Down
8 changes: 4 additions & 4 deletions packages/angular-ivy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular-ivy",
"version": "7.71.0",
"version": "7.72.0",
"description": "Official Sentry SDK for Angular with full Ivy Support",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy",
Expand All @@ -21,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.71.0",
"@sentry/types": "7.71.0",
"@sentry/utils": "7.71.0",
"@sentry/browser": "7.72.0",
"@sentry/types": "7.72.0",
"@sentry/utils": "7.72.0",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular",
"version": "7.71.0",
"version": "7.72.0",
"description": "Official Sentry SDK for Angular",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
Expand All @@ -21,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.71.0",
"@sentry/types": "7.71.0",
"@sentry/utils": "7.71.0",
"@sentry/browser": "7.72.0",
"@sentry/types": "7.72.0",
"@sentry/utils": "7.72.0",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "7.71.0",
"version": "7.72.0",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down
35 changes: 20 additions & 15 deletions packages/browser-integration-tests/suites/replay/bufferMode/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ sentryTest(
await reqErrorPromise;
expect(callsToSentry).toEqual(2);

await page.evaluate(async () => {
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
});

const req0 = await reqPromise0;
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
]);

// 2 errors, 1 flush
await reqErrorPromise;
Expand Down Expand Up @@ -226,12 +227,13 @@ sentryTest(
await reqErrorPromise;
expect(callsToSentry).toEqual(2);

await page.evaluate(async () => {
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
});

const req0 = await reqPromise0;
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
]);

// 2 errors, 1 flush
await reqErrorPromise;
Expand Down Expand Up @@ -346,9 +348,12 @@ sentryTest(

// Error sample rate is now at 1.0, this error should create a replay
const reqErrorPromise1 = waitForErrorRequest(page);
await page.click('#error2');
// 1 unsampled error, 1 sampled error -> 1 flush
const req0 = await reqPromise0;
const [req0] = await Promise.all([
// 1 unsampled error, 1 sampled error -> 1 flush
reqPromise0,
page.click('#error2'),
]);

const reqError1 = await reqErrorPromise1;
const errorEvent1 = envelopeRequestParser(reqError1);
expect(callsToSentry).toEqual(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ sentryTest('should capture console messages in replay', async ({ getLocalTestPat
sentryTest.skip();
}

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
Expand All @@ -20,10 +18,11 @@ sentryTest('should capture console messages in replay', async ({ getLocalTestPat
});
});

const reqPromise0 = waitForReplayRequest(page, 0);

const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
await reqPromise0;
await Promise.all([page.goto(url), reqPromise0]);

const reqPromise1 = waitForReplayRequest(
page,
Expand All @@ -38,11 +37,10 @@ sentryTest('should capture console messages in replay', async ({ getLocalTestPat
await page.click('[data-log]');

// Sometimes this doesn't seem to trigger, so we trigger it twice to be sure...
await page.click('[data-log]');

const [req1] = await Promise.all([reqPromise1, page.click('[data-log]')]);
await forceFlushReplay();

const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1);
const { breadcrumbs } = getCustomRecordingEvents(req1);

expect(breadcrumbs.filter(breadcrumb => breadcrumb.category === 'console')).toEqual(
expect.arrayContaining([
Expand All @@ -65,8 +63,6 @@ sentryTest('should capture very large console logs', async ({ getLocalTestPath,
sentryTest.skip();
}

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
Expand All @@ -75,10 +71,11 @@ sentryTest('should capture very large console logs', async ({ getLocalTestPath,
});
});

const reqPromise0 = waitForReplayRequest(page, 0);

const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
await reqPromise0;
await Promise.all([page.goto(url), reqPromise0]);

const reqPromise1 = waitForReplayRequest(
page,
Expand All @@ -90,14 +87,10 @@ sentryTest('should capture very large console logs', async ({ getLocalTestPath,
5_000,
);

await page.click('[data-log-large]');

// Sometimes this doesn't seem to trigger, so we trigger it twice to be sure...
await page.click('[data-log-large]');

const [req1] = await Promise.all([reqPromise1, page.click('[data-log-large]')]);
await forceFlushReplay();

const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1);
const { breadcrumbs } = getCustomRecordingEvents(req1);

expect(breadcrumbs.filter(breadcrumb => breadcrumb.category === 'console')).toEqual(
expect.arrayContaining([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,25 @@ sentryTest(

const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
await page.click('#go-background');
await new Promise(resolve => setTimeout(resolve, 1000));
await Promise.all([
page.goto(url),
page.click('#go-background'),
new Promise(resolve => setTimeout(resolve, 1000)),
]);

expect(callsToSentry).toEqual(0);

await page.click('#error');
const req0 = await reqPromise0;
const [req0] = await Promise.all([reqPromise0, page.click('#error')]);

expect(callsToSentry).toEqual(2); // 1 error, 1 replay event

await page.click('#go-background');
const req1 = await reqPromise1;
await reqErrorPromise;
const [req1] = await Promise.all([reqPromise1, page.click('#go-background'), reqErrorPromise]);

expect(callsToSentry).toEqual(3); // 1 error, 2 replay events

await page.click('#log');
await page.click('#go-background');
const req2 = await reqPromise2;

const [req2] = await Promise.all([reqPromise2, page.click('#go-background')]);

const event0 = getReplayEvent(req0);
const content0 = getReplayRecordingContent(req0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ sentryTest(
sentryTest.skip();
}

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
Expand All @@ -22,26 +20,17 @@ sentryTest(

const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
const res0 = await reqPromise0;

const reqPromise1 = waitForReplayRequest(page);

void page.click('#button-add');
const [res0] = await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]);
await forceFlushReplay();
const res1 = await reqPromise1;

const reqPromise2 = waitForReplayRequest(page);

void page.click('#button-modify');
const [res1] = await Promise.all([waitForReplayRequest(page), page.click('#button-add')]);
await forceFlushReplay();
const res2 = await reqPromise2;

const reqPromise3 = waitForReplayRequest(page);
const [res2] = await Promise.all([waitForReplayRequest(page), page.click('#button-modify')]);
await forceFlushReplay();

void page.click('#button-remove');
const [res3] = await Promise.all([waitForReplayRequest(page), page.click('#button-remove')]);
await forceFlushReplay();
const res3 = await reqPromise3;

const replayData0 = getReplayRecordingContent(res0);
const replayData1 = getReplayRecordingContent(res1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ sentryTest(
sentryTest.skip();
}

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
Expand All @@ -25,23 +23,24 @@ sentryTest(
});
});

const reqPromise0 = waitForReplayRequest(page, 0);

const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
const res0 = await reqPromise0;
const [res0] = await Promise.all([reqPromise0, page.goto(url)]);
await forceFlushReplay();

const reqPromise1 = waitForReplayRequest(page);

void page.click('#button-add');
const [res1] = await Promise.all([reqPromise1, page.click('#button-add')]);
await forceFlushReplay();
const res1 = await reqPromise1;

// replay should be stopped due to mutation limit
let replay = await getReplaySnapshot(page);
expect(replay.session).toBe(undefined);
expect(replay._isEnabled).toBe(false);

void page.click('#button-modify');
await page.click('#button-modify');
await forceFlushReplay();

await page.click('#button-remove');
Expand Down
Loading

0 comments on commit a0c2a88

Please sign in to comment.