Skip to content

Fix: Don't overwrite the transaction on an event if it's already been set. #2129

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

Merged

Conversation

ThatTobMate
Copy link
Contributor

@ThatTobMate ThatTobMate commented Jun 21, 2019

This PR prevents the transaction property being overwritten if it has already been set on the event.
v5.2.0 saw the introduction of the setTransaction function on the scopes . The value set using this function in @sentry/node isn't being respected currently.

Setting the transaction in @sentry/browser works fine.

Example issue

When I inspect the current scope after I've used the scope.setTransaction call I can see the transaction is set correctly, however if I check the event in the beforeSend callback it's been changed.

Transaction value from the current scope before submitting an error

Screenshot 2019-06-21 at 11 28 00

Transaction value from beforeSend

Screenshot 2019-06-21 at 11 28 08

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@ThatTobMate ThatTobMate requested a review from kamilogorek as a code owner June 21, 2019 11:33
Copy link

@andybriggs andybriggs left a comment

Choose a reason for hiding this comment

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

💥

Copy link
Member

@HazAT HazAT left a comment

Choose a reason for hiding this comment

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

Thanks! 💯

@HazAT HazAT merged commit 55311df into getsentry:master Jun 21, 2019
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.

3 participants