Skip to content

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

Merged
Lms24 merged 1 commit into
masterfrom
lms-fix-replay-tunnel
Dec 16, 2022
Merged

fix(replay): Send dsn in envelope header if tunneling is enabled#6568
Lms24 merged 1 commit into
masterfrom
lms-fix-replay-tunnel

Conversation

@Lms24

@Lms24Lms24 commented Dec 16, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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.

@Lms24Lms24 changed the title fix(replay): Send dsn in envelope header if tunneling is activefix(replay): Send dsn in envelope header if tunneling is enabledDec 16, 2022
@Lms24Lms24 self-assigned this Dec 16, 2022
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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
Copy Markdown
MemberAuthor

Going to merge this in to unblock our next release.

@Lms24
Lms24 merged commit 5961a96 into masterDec 16, 2022
@Lms24
Lms24 deleted the lms-fix-replay-tunnel branch December 16, 2022 10:20
Sign up for freeto 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.

[Replay] NextJS tunnel fails to passthrough Replay payloads

2 participants

@Lms24@lforst