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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Respect existing baggage header instead of overwriting it #1995

Merged
merged 9 commits into from Jul 25, 2022

Conversation

kevinrenskers
Copy link
Contributor

@kevinrenskers kevinrenskers commented Jul 21, 2022

馃摐 Description

SentryNetworkTracker adds a baggage header with some sentry keys and values, but it does so by completely overwriting any possibly existing baggage header. And when we remove the baggage header when SentrySDK.currentHub.scope.span is nil, we also do that by removing the entire baggage header instead of only the sentry-trace_id key that we actually need to remove.

Now we respect the existing baggage header, if it's there, by modifying it.

馃挕 Motivation and Context

Closes #1911

馃挌 How did you test it?

Unit tests.

馃摑 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • Review from the native team if needed
  • No breaking changes

馃敭 Next steps

@kevinrenskers
Copy link
Contributor Author

The only test that keeps failing is the "UI Tests on iOS 12 Simulator" one, with the usual "Failed to get matching snapshots: Timed out while evaluating UI query". But I haven't touched the UI in this PR at all, so that's weird. I'll download the iOS 12 simulator on my computer, see if I can spot the problem.

@kevinrenskers
Copy link
Contributor Author

Sample app looks like this in iOS 12 馃檲

Simulator Screen Shot - iPhone 8 - 2022-07-22 at 12 41 09

Fixed it.

@kevinrenskers
Copy link
Contributor Author

We have one failing UI test on iOS 12, which is unrelated to this PR and has started happening a while ago. I created a separate issue for this (#2000), I don't think it should block this PR.

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

LGTM

@brustolin brustolin merged commit 2e5ea2c into master Jul 25, 2022
@brustolin brustolin deleted the fix/1911-respect-existing-baggage branch July 25, 2022 10:00
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.

Respect already existing baggage header on outgoing http requests
2 participants