Skip to content

fix(replay): attach replay ID from when the feedback widget opened - #24570

Merged
mydea merged 4 commits into
developfrom
joshgoldberg/replay-1000-flush-recording-buffer-when-user-feedback-is-opened-vs-sent
Sep 22, 2026
Merged

mydea merged 4 commits into
developfrom
joshgoldberg/replay-1000-flush-recording-buffer-when-user-feedback-is-opened-vs-sent

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Sep 21, 2026

Copy link
Copy Markdown
Member

#17236 (just over a year ago) actually already flushes the replay when the feedback widget opens. But the replay ID was read at submission, so a session refresh while the form was open linked the feedback to a new, never-sent buffered replay. Widget submissions now use the replay ID captured when the widget opened.

Closes REPLAY-1000.

The widget flushes the replay when it opens, but the replay ID was read at submission. If the
session refreshed while the form was open, feedback linked to a new, unsent buffered replay
instead of the one that was flushed. Keep the replay ID captured on open for widget submissions.

Refs REPLAY-1000
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

REPLAY-1000

@JoshuaKGoldberg JoshuaKGoldberg changed the title fix(replay): Attach replay ID from when the feedback widget opened fix(replay): attach replay ID from when the feedback widget opened Sep 21, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JoshuaKGoldberg

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ffa138a. Configure here.

Comment thread packages/replay-internal/src/util/addGlobalListeners.ts
Comment thread packages/replay-internal/test/integration/feedback.test.ts
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.07 kB - -
@sentry/browser - with treeshaking flags 27.34 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.24 kB - -
@sentry/browser (incl. Tracing) 50.56 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.58 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.58 kB - -
@sentry/browser (incl. Tracing, Replay) 90.17 kB +0.06% +50 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.26 kB +0.07% +53 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 94.86 kB +0.06% +48 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 107.83 kB +0.05% +45 B 🔺
@sentry/browser (incl. Feedback) 46.6 kB - -
@sentry/browser (incl. sendFeedback) 34.13 kB - -
@sentry/browser (incl. FeedbackAsync) 39.25 kB - -
@sentry/browser (incl. Metrics) 30.08 kB - -
@sentry/browser (incl. Logs) 30.34 kB - -
@sentry/browser (incl. Metrics & Logs) 31 kB - -
@sentry/react 30.82 kB - -
@sentry/react (incl. Tracing) 52.89 kB - -
@sentry/vue 36.33 kB - -
@sentry/vue (incl. Tracing) 52.87 kB - -
@sentry/svelte 29.1 kB - -
CDN Bundle 30.77 kB - -
CDN Bundle (incl. Tracing) 51.09 kB - -
CDN Bundle (incl. Logs, Metrics) 33.02 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.07 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.77 kB +0.08% +57 B 🔺
CDN Bundle (incl. Tracing, Replay) 88.68 kB +0.06% +46 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.61 kB +0.06% +50 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 94.72 kB +0.06% +52 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.75 kB +0.06% +50 B 🔺
CDN Bundle - uncompressed 91.07 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.52 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.64 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.48 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.21 kB +0.08% +159 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.25 kB +0.06% +159 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 278.19 kB +0.06% +159 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.95 kB +0.06% +159 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.88 kB +0.06% +159 B 🔺
@sentry/nextjs (client) 55.22 kB - -
@sentry/sveltekit (client) 51.01 kB - -
@sentry/core/server 39.93 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 133.37 kB +0.02% +19 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.15 kB - -
@sentry/node - without tracing 89.92 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 112.16 kB +0.02% +22 B 🔺
@sentry/aws-serverless 98.19 kB +0.02% +18 B 🔺
@sentry/cloudflare (withSentry) - minified 204.67 kB - -
@sentry/cloudflare (withSentry) 509.34 kB - -

View base workflow run

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review September 21, 2026 15:59
@JoshuaKGoldberg
JoshuaKGoldberg requested a review from a team as a code owner September 21, 2026 15:59
@JoshuaKGoldberg
JoshuaKGoldberg requested review from Lms24, billyvg and logaretm and removed request for a team September 21, 2026 15:59

@logaretm logaretm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple of comments, otherwise LGTM

Comment thread packages/replay-internal/src/coreHandlers/handleGlobalEvent.ts Outdated
Comment thread packages/replay-internal/src/util/addGlobalListeners.ts
Comment thread packages/replay-internal/src/util/addGlobalListeners.ts
Also clear the replay ID captured on widget open once it's used, and
cover feedback sent after replay is stopped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

if (isFeedbackEvent(event)) {
// The feedback widget links the replay from when it was opened. If the session
// refreshed since then, don't flush or add a breadcrumb to the unlinked new session

@JoshuaKGoldberg JoshuaKGoldberg Sep 21, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

[Non-Actionable] Fun fact: this is one of the few times recently I've added a comment. Cursor didn't write one originally! But I figured the rest of this area/file is pretty comment-rich.

@logaretm logaretm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@mydea
mydea merged commit f5c65b6 into develop Sep 22, 2026
637 of 639 checks passed
@mydea
mydea deleted the joshgoldberg/replay-1000-flush-recording-buffer-when-user-feedback-is-opened-vs-sent branch September 22, 2026 06:59
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