Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(replay): Send dsn in envelope header if tunneling is enabled #6568

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Dec 16, 2022

As outlined in #6539, we're right now not sending the dsn key in the replay event envelope header, thereby not including the necessary information to forward the event to Sentry.

This PR fixes that by extracting the createEventEnvelopeHeaders function to utils so that we can use it in Replay (analogously to #6514), as well as using this function to create all headers.

We tested this PR with NextJS' tunnelRoute as well as with the conventional tunnel option and everything seems to work now.

Note: While refactoring and adding tests, I discovered that right now, replay event envelopes always contain the identical replayId as event_id and replay_id. Not sure if this is intended but I'm not changing this in this PR (cc @billyvg).

fixes #6539

Comment on lines +924 to +926
const dsn = client?.getDsn();

if (!client || !scope || !transport) {
if (!client || !scope || !transport || !dsn) {
Copy link
Member Author

Choose a reason for hiding this comment

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

just adding this here so we can be certain, dsn isn't undefined further below. In case we don't have a dsn, we can't send anything anyway.

@Lms24 Lms24 changed the title fix(replay): Send dsn in envelope header if tunneling is active fix(replay): Send dsn in envelope header if tunneling is enabled Dec 16, 2022
@Lms24 Lms24 self-assigned this Dec 16, 2022
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.79 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 61.27 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.57 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.8 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.34 KB (0%)
@sentry/browser - Webpack (minified) 66.48 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.36 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.56 KB (-0.03% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.76 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.19 KB (0%)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.08 KB (+0.46% 🔺)
@sentry/replay - Webpack (gzipped + minified) 38.13 KB (+0.04% 🔺)

@Lms24
Copy link
Member Author

Lms24 commented Dec 16, 2022

Going to merge this in to unblock our next release.

@Lms24 Lms24 merged commit 5961a96 into master Dec 16, 2022
@Lms24 Lms24 deleted the lms-fix-replay-tunnel branch December 16, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Replay] NextJS tunnel fails to passthrough Replay payloads
2 participants