Skip to content

Commit d789766

Browse files
authored
fix(node): Missing release from ANR sessions (#15138)
1 parent 1c8dee8 commit d789766

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

dev-packages/node-integration-tests/suites/anr/basic-session.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ setTimeout(() => {
99

1010
Sentry.init({
1111
dsn: process.env.SENTRY_DSN,
12-
release: '1.0',
12+
release: '1.0.0',
1313
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1414
});
1515

dev-packages/node-integration-tests/suites/anr/test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ describe('should report ANR when event loop blocked', () => {
188188
session: {
189189
status: 'abnormal',
190190
abnormal_mechanism: 'anr_foreground',
191+
attrs: {
192+
release: '1.0.0',
193+
},
191194
},
192195
})
193196
.expect({ event: ANR_EVENT_WITH_SCOPE })

packages/node/src/integrations/anr/worker.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ async function sendAbnormalSession(): Promise<void> {
4646
// of we have an existing session passed from the main thread, send it as abnormal
4747
if (session) {
4848
log('Sending abnormal session');
49-
updateSession(session, { status: 'abnormal', abnormal_mechanism: 'anr_foreground' });
49+
50+
updateSession(session, {
51+
status: 'abnormal',
52+
abnormal_mechanism: 'anr_foreground',
53+
release: options.release,
54+
environment: options.environment,
55+
});
5056

5157
const envelope = createSessionEnvelope(session, options.dsn, options.sdkMetadata, options.tunnel);
5258
// Log the envelope so to aid in testing

0 commit comments

Comments
 (0)