Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 10, 2025

This PR fixes an oversight in our session update logic when we update the SDK's session status while processing an error event. Previously, we'd always set status: 'crashed' as soon as the top-level event.level field was set to 'fatal' (added in #15072). However, this disregarded the case where the level was initially 'fatal' but later on the SDK or users decided to set the event.exceptions.values[i].mechanism.handled field to true.

Simplest reproduction:

Sentry.captureException(new Error('test'), { captureContext: { level: 'fatal' } });

This PR changes the update logic to only look at the event mechanisms if the event contained exceptions. I think this is still compatible with #15072 because the PR suggests we only care about event.level === 'fatal' if no exceptions are on the event. But I'd appreciate a second pair of eyes on this (cc @timfish).

@Lms24 Lms24 requested a review from timfish November 10, 2025 12:46
@Lms24 Lms24 self-assigned this Nov 10, 2025
@Lms24 Lms24 requested review from a team, RulaKhaled and andreiborza and removed request for a team and RulaKhaled November 10, 2025 12:47
@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.59 kB -0.01% -2 B 🔽
@sentry/browser - with treeshaking flags 23.08 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing) 41.23 kB +0.02% +5 B 🔺
@sentry/browser (incl. Tracing, Profiling) 45.5 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay) 79.7 kB +0.01% +3 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.38 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.4 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.57 kB - -
@sentry/browser (incl. Feedback) 41.27 kB -0.01% -1 B 🔽
@sentry/browser (incl. sendFeedback) 29.26 kB -0.01% -1 B 🔽
@sentry/browser (incl. FeedbackAsync) 34.19 kB -0.01% -1 B 🔽
@sentry/react 26.29 kB +0.01% +1 B 🔺
@sentry/react (incl. Tracing) 43.21 kB +0.01% +2 B 🔺
@sentry/vue 29.07 kB -0.01% -2 B 🔽
@sentry/vue (incl. Tracing) 43 kB +0.01% +4 B 🔺
@sentry/svelte 24.6 kB -0.02% -3 B 🔽
CDN Bundle 26.89 kB +0.02% +4 B 🔺
CDN Bundle (incl. Tracing) 41.78 kB +0.02% +5 B 🔺
CDN Bundle (incl. Tracing, Replay) 78.3 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 83.78 kB +0.01% +5 B 🔺
CDN Bundle - uncompressed 78.84 kB -0.01% -7 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 123.96 kB -0.01% -7 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 239.99 kB -0.01% -7 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 252.75 kB -0.01% -7 B 🔽
@sentry/nextjs (client) 45.31 kB +0.01% +2 B 🔺
@sentry/sveltekit (client) 41.61 kB +0.01% +4 B 🔺
@sentry/node-core 50.76 kB +0.01% +4 B 🔺
@sentry/node 157.84 kB +0.01% +2 B 🔺
@sentry/node - without tracing 92.64 kB +0.01% +5 B 🔺
@sentry/aws-serverless 106.41 kB +0.01% +3 B 🔺

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,117 - 8,962 +2%
GET With Sentry 1,394 15% 1,428 -2%
GET With Sentry (error only) 6,031 66% 6,119 -1%
POST Baseline 1,198 - 1,212 -1%
POST With Sentry 497 41% 528 -6%
POST With Sentry (error only) 1,037 87% 1,066 -3%
MYSQL Baseline 3,240 - 3,357 -3%
MYSQL With Sentry 423 13% 509 -17%
MYSQL With Sentry (error only) 2,637 81% 2,759 -4%

View base workflow run

@Lms24 Lms24 changed the title fix(core): Only use exception mechanism when updating session status from events with exceptions fix(core): Only consider exception mechanism when updating session status from events with exceptions Nov 10, 2025
@Lms24 Lms24 changed the title fix(core): Only consider exception mechanism when updating session status from events with exceptions fix(core): Only consider exception mechanism when updating session status from event with exceptions Nov 10, 2025
@Lms24 Lms24 merged commit 6de4cba into develop Nov 10, 2025
381 of 383 checks passed
@Lms24 Lms24 deleted the lms/fix-core-session-status-based-on-mechanism branch November 10, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants