GeezerVison is showing github.com — fix: Apply stack frame metadata before event processors by lforst · Pull Request #12799 · getsentry/sentry-javascript
Conversation
lforst
commented
Jul 8, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #12704
Previously we had a bug where stack frame metadata wasn't properly applied when something rewrote the stack frame file names in a way that wouldn't allow us to associate the injected metadata stack traces with the stack frames. This boils down to a timing issue where we would attempt to write the stack frame metadata onto the stack frames after the event processors have run, even though we should do that before they run.
To solve this timing issue, this PR adds a hook applyFrameMetadata to the client that signals the moment frame metadata should be attached. Additionally we update all of the integrations that make use of frame metadata to use this hook.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
| Path |
Size |
| @sentry/browser |
22.29 KB (+0.07% 🔺) |
| @sentry/browser (incl. Tracing) |
33.44 KB (+0.05% 🔺) |
| @sentry/browser (incl. Tracing, Replay) |
69.19 KB (+0.02% 🔺) |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
62.52 KB (+0.02% 🔺) |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
73.25 KB (+0.03% 🔺) |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
85.88 KB (+0.02% 🔺) |
| @sentry/browser (incl. Tracing, Replay, Feedback, metrics) |
87.74 KB (+0.02% 🔺) |
| @sentry/browser (incl. metrics) |
26.58 KB (+0.05% 🔺) |
| @sentry/browser (incl. Feedback) |
38.97 KB (+0.04% 🔺) |
| @sentry/browser (incl. sendFeedback) |
26.92 KB (+0.06% 🔺) |
| @sentry/browser (incl. FeedbackAsync) |
31.53 KB (+0.05% 🔺) |
| @sentry/react |
25.04 KB (+0.08% 🔺) |
| @sentry/react (incl. Tracing) |
36.48 KB (+0.05% 🔺) |
| @sentry/vue |
26.4 KB (+0.05% 🔺) |
| @sentry/vue (incl. Tracing) |
35.3 KB (+0.05% 🔺) |
| @sentry/svelte |
22.43 KB (+0.06% 🔺) |
| CDN Bundle |
23.51 KB (+0.06% 🔺) |
| CDN Bundle (incl. Tracing) |
35.21 KB (+0.05% 🔺) |
| CDN Bundle (incl. Tracing, Replay) |
69.31 KB (+0.03% 🔺) |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
74.5 KB (+0.04% 🔺) |
| CDN Bundle - uncompressed |
69 KB (+0.05% 🔺) |
| CDN Bundle (incl. Tracing) - uncompressed |
104.02 KB (+0.04% 🔺) |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
214.41 KB (+0.02% 🔺) |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
227.12 KB (+0.02% 🔺) |
| @sentry/nextjs (client) |
36.36 KB (+0.04% 🔺) |
| @sentry/sveltekit (client) |
34.09 KB (+0.05% 🔺) |
| @sentry/node |
130.86 KB (+0.02% 🔺) |
| @sentry/node - without tracing |
91.88 KB (+0.02% 🔺) |
| @sentry/aws-serverless |
117.04 KB (+0.02% 🔺) |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
return event;
|
|
|
client.on('applyFrameMetadata', event => {
|
|
|
// Only apply stack frame metadata to error events
|
|
|
if (event.type !== undefined) {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
if (event.type !== undefined) { |
|
if (event.type) { |
slightly smaller?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
client.on('applyFrameMetadata', event => {
|
|
|
// Only apply stack frame metadata to error events
|
|
|
if (event.type !== undefined) {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
if (event.type !== undefined) { |
|
if (event.type) { |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 30, 2024
This was referenced Aug 9, 2024
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|