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: Don't set incompatible platform on Sentry events #1762

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lforst
Copy link

@lforst lforst commented Feb 25, 2025

#1669 broke symbolication in Sentry because web:javascript is not a platform that Sentry understands.

Sentry uses the platform field to understand how to symbolicate an error and if it is an unknown value it bails. The code can be found here: https://github.com/getsentry/sentry/blob/c1fcd79e4bcd67f25e2b570e424e0758b5ee167f/src/sentry/lang/javascript/processing.py#L178-L180

The previously introduced change mutated the Sentry event in an incompatible way that is compatible with posthog. This change switches over to copying instead of mutating so that we don't break the contract with Sentry.

Note: I am one of the maintainers of the Sentry JS SDK.

Copy link

vercel bot commented Feb 25, 2025

@lforst is attempting to deploy a commit to the PostHog Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes Sentry error symbolication by preventing mutation of the platform field in Sentry events.

  • Modified src/extensions/sentry-integration.ts to copy exception data instead of directly mutating the Sentry event
  • Preserves Sentry's expected platform values for proper error symbolication
  • Maintains PostHog's ability to track exceptions with its own platform format
  • Addresses a regression introduced in PR fix: sentry integration fields #1669 that broke Sentry's error processing
  • Ensures compatibility between PostHog and Sentry by respecting Sentry's platform value requirements

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@lforst
Copy link
Author

lforst commented Feb 25, 2025

Tagging @oliverb123 because you reviewed the PR that broke things.

@marandaneto
Copy link
Member

hi @lforst :D

@marandaneto marandaneto requested a review from a team February 25, 2025 12:46
@lforst
Copy link
Author

lforst commented Feb 25, 2025

@marandaneto I can feel some special treatment with this PR 😂

@pauldambra
Copy link
Member

fly-by to say thank you for taking time to raise the PR 💖 @lforst

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.

4 participants