fix(core): Temporarily store debug IDs in stack frame and only put them into debug_meta
before sending
#8347
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are currently facing the problem that the
RewriteFrames
integration, that is existing in many users setups, is breaking debug IDs. This is especially annoying when moving from the old release based source map process to the new debug ID based process.How is the
RewriteFrames
integration is breaking debug IDs? Stack frames are linked to debug IDs via thefilename
value inside stack frames in the event and thedebug_file
value inside thedebug_meta
field.filename
anddebug_file
are both generated at event creation (before any event processors run) and need to exactly match. When aRewriteFrames
integration is active, it may register an event processor that modifies thefilename
. This causes thefilename
->debug_file
relationship to break, causing the entire debug ID process to break.This PR aims to fix this by putting
debug_id
values directly on the stack frame objects inside events and only transferring them over todebug_meta
after all event processors ran, right before the event is sent. This way, we guarantee that the stack frames will always point to a debug ID (if there is one).