test(browser): Add integration test for changing transaction name in beforeSendTransaction
#14495
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.
This came up in an internal conversation: Some users need to update the transcation name in
beforeSendTransaction
. While we strictly recommend changing the root span/transaction name as early as possible, it should nevertheless be possible at the end of the root span lifecycle, too.This test demonstrates that this works but it also shows "unexpected" behaviour: Despite users setting an explicit source in
beforeSendTransaction
, we overwrite the source to'custom'
. There's good reason for this in general: Changing the name of something the SDK previously identified as sourceurl
orroute
should be reflected by the source. But we don't account for the case where users explicitly set the source.For the moment though, this not an actual problem because
sources
route
andcustom
are treated equally by Relay.