Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Oct 2, 2025

This PR fixes a case where we [correctly] tag an error event w/ replay id, but something occurs where the replay event does not end up being flushed. This means the existing session is still in a buffered state, and will keep its session id until a new error event is sampled and a replay is created. When this does happen, we can have a replay with a super long duration (e.g. the time between the two error replays).

We now update the session immediately when we tag an error event w/ replay id so that if the replay event does not successfully flush, the session will respect its expiration date.

This PR fixes a case where we [correctly] tag an error event w/ replay id, but something occurs where the replay event does not end up being flushed. This means the existing session is still in a buffered state, and will keep its session id until a new error event is sampled and a replay is created. When this does happen, we can have a replay with a super long duration (e.g. the time between the two error replays).

We now update the session immediately when we tag an error event w/ replay id so that if the replay event does not successfully flush, the session will respect its expiration date.
@linear
Copy link

linear bot commented Oct 2, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.63 kB - -
@sentry/browser - with treeshaking flags 23.11 kB - -
@sentry/browser (incl. Tracing) 40.97 kB - -
@sentry/browser (incl. Tracing, Profiling) 45.26 kB - -
@sentry/browser (incl. Tracing, Replay) 79.33 kB +0.06% +42 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.02 kB +0.07% +46 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.03 kB +0.06% +42 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.2 kB +0.05% +41 B 🔺
@sentry/browser (incl. Feedback) 41.3 kB - -
@sentry/browser (incl. sendFeedback) 29.29 kB - -
@sentry/browser (incl. FeedbackAsync) 34.22 kB - -
@sentry/react 26.31 kB - -
@sentry/react (incl. Tracing) 42.97 kB - -
@sentry/vue 29.11 kB - -
@sentry/vue (incl. Tracing) 42.75 kB - -
@sentry/svelte 24.64 kB - -
CDN Bundle 26.9 kB - -
CDN Bundle (incl. Tracing) 41.62 kB - -
CDN Bundle (incl. Tracing, Replay) 77.91 kB +0.06% +39 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 83.38 kB +0.05% +37 B 🔺
CDN Bundle - uncompressed 78.86 kB - -
CDN Bundle (incl. Tracing) - uncompressed 123.44 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 238.66 kB +0.08% +181 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 251.42 kB +0.08% +181 B 🔺
@sentry/nextjs (client) 45.11 kB - -
@sentry/sveltekit (client) 41.4 kB - -
@sentry/node-core 50.81 kB - -
@sentry/node 157.87 kB - -
@sentry/node - without tracing 92.69 kB - -
@sentry/aws-serverless 106.41 kB - -

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 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,252 - 8,512 +9%
GET With Sentry 1,436 16% 1,378 +4%
GET With Sentry (error only) 6,336 68% 6,148 +3%
POST Baseline 1,233 - 1,191 +4%
POST With Sentry 565 46% 521 +8%
POST With Sentry (error only) 1,087 88% 1,053 +3%
MYSQL Baseline 3,416 - 3,286 +4%
MYSQL With Sentry 548 16% 424 +29%
MYSQL With Sentry (error only) 2,796 82% 2,680 +4%

View base workflow run

@billyvg billyvg marked this pull request as ready for review October 9, 2025 00:31
@billyvg billyvg requested a review from a team as a code owner October 9, 2025 00:31
@billyvg billyvg requested a review from chargome October 9, 2025 00:31
cursor[bot]

This comment was marked as outdated.

Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM – We should at some point add a diagram/state machine to docs to make the whole buffer/session lifecycle more comprehensible with all the edge cases

@billyvg billyvg merged commit 993303c into develop Oct 28, 2025
149 checks passed
@billyvg billyvg deleted the billy/replay-575-replay-w-linked-errors-from-prior-week branch October 28, 2025 20:24
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