Skip to content

Conversation

mydea
Copy link
Member

@mydea mydea commented Dec 30, 2024

This PR ensures that we always take the session from the isolation scope, never from the current scope.

This has the implication that we need to be sure to pass the isolation scope to _processEvent, as this is where the session may be marked as errored. For this, I updated the internal method _processEvent to take the isolation scope as last argument, as well as streamlining this slightly.

I opted to update the signature of the protected _prepareEvent method too, and make currentScope/isolationScope required there. We already always pass this in now, so it safes a few bytes to avoid the fallback everywhere. This should not really affect users unless they overwrite the _processEvent method, which is internal/private anyhow, so IMHO this should be fine. I added a small note to the migration guide anyhow!

@mydea mydea requested review from Lms24 and lforst December 30, 2024 13:58
@mydea mydea self-assigned this Dec 30, 2024
Copy link
Contributor

github-actions bot commented Dec 30, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.77 KB -0.08% -17 B 🔽
@sentry/browser - with treeshaking flags 21.52 KB -0.05% -9 B 🔽
@sentry/browser (incl. Tracing) 35.35 KB -0.04% -12 B 🔽
@sentry/browser (incl. Tracing, Replay) 72.56 KB -0.02% -12 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.95 KB -0.01% -6 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 76.95 KB -0.02% -12 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 89.32 KB -0.02% -15 B 🔽
@sentry/browser (incl. Feedback) 39.53 KB -0.07% -25 B 🔽
@sentry/browser (incl. sendFeedback) 27.41 KB -0.05% -12 B 🔽
@sentry/browser (incl. FeedbackAsync) 32.17 KB -0.06% -17 B 🔽
@sentry/react 25.54 KB -0.02% -4 B 🔽
@sentry/react (incl. Tracing) 38.16 KB -0.02% -6 B 🔽
@sentry/vue 27.06 KB -0.01% -1 B 🔽
@sentry/vue (incl. Tracing) 37.22 KB -0.01% -1 B 🔽
@sentry/svelte 22.94 KB -0.07% -15 B 🔽
CDN Bundle 24.13 KB -0.15% -37 B 🔽
CDN Bundle (incl. Tracing) 35.66 KB -0.15% -52 B 🔽
CDN Bundle (incl. Tracing, Replay) 70.7 KB -0.07% -45 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 75.91 KB -0.06% -45 B 🔽
CDN Bundle - uncompressed 70.59 KB -0.22% -156 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 106.06 KB -0.15% -156 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 219.99 KB -0.07% -156 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 232.86 KB -0.07% -156 B 🔽
@sentry/nextjs (client) 38.48 KB -0.02% -4 B 🔽
@sentry/sveltekit (client) 35.88 KB -0.03% -8 B 🔽
@sentry/node 162.88 KB -0.02% -19 B 🔽
@sentry/node - without tracing 98.66 KB -0.02% -18 B 🔽
@sentry/aws-serverless 128.5 KB -0.01% -13 B 🔽

View base workflow run

Copy link

codecov bot commented Dec 30, 2024

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
693 3 690 294
View the top 3 failed tests by shortest run time
sessions/update-session/test.ts should update session when an error is thrown.
Stack Traces | 0.269s run time
test.ts:7:11 should update session when an error is thrown.
sessions/update-session/test.ts should update session when an exception is captured.
Stack Traces | 0.287s run time
test.ts:24:11 should update session when an exception is captured.
client/sessions.test.ts should report crashed sessions
Stack Traces | 30s run time
sessions.test.ts:16:5 should report crashed sessions

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@mydea mydea force-pushed the fn/session-currentScope branch 2 times, most recently from d0d8339 to a80d35a Compare January 2, 2025 08:05
@mydea mydea changed the title ref(core): Stop setting session on current scope feat(core): Always use session from isolation scope Jan 2, 2025
@mydea mydea changed the title feat(core): Always use session from isolation scope feat(core)!: Always use session from isolation scope Jan 2, 2025
@mydea mydea requested a review from AbhiPrasad January 2, 2025 08:12
@mydea mydea force-pushed the fn/session-currentScope branch from 3355348 to 6380c4e Compare January 3, 2025 11:02
@mydea mydea merged commit 64d36a9 into develop Jan 3, 2025
153 checks passed
@mydea mydea deleted the fn/session-currentScope branch January 3, 2025 11:39
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.

2 participants