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: Apply stack frame metadata before event processors #12799

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

lforst
Copy link
Member

@lforst lforst commented Jul 8, 2024

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.

Verified

This commit was signed with the committer’s verified signature.
Byron Sebastian Thiel
Copy link
Contributor

github-actions bot commented Jul 8, 2024

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% 🔺)

Verified

This commit was signed with the committer’s verified signature.
Byron Sebastian Thiel
@lforst lforst marked this pull request as ready for review July 9, 2024 09:22
@lforst lforst requested review from timfish, mydea and chargome July 9, 2024 09:22
return event;
client.on('applyFrameMetadata', event => {
// Only apply stack frame metadata to error events
if (event.type !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (event.type !== undefined) {
if (event.type) {

slightly smaller?


client.on('applyFrameMetadata', event => {
// Only apply stack frame metadata to error events
if (event.type !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (event.type !== undefined) {
if (event.type) {

@lforst lforst merged commit a5ea680 into develop Jul 9, 2024
120 of 121 checks passed
@lforst lforst deleted the lforst-fix-order-issue-for-frame-metadata branch July 9, 2024 11:30
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.

Parsing Issue with moduleMetadataIntegration in Next.js Micro Frontend Setup Using Sentry
3 participants