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

feat(develop): Allow to pass user_agent as browser context #13205

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

Conversation

mydea
Copy link
Member

@mydea mydea commented Apr 2, 2025

Related to #13203

Today, the browser context is inferred in relay from event.request.headers['user-agent']. This is slightly weird in the context of a browser event, as the page is not really the request - we want to replace this with something more explicit.

In order to make this possible, we propose to allow client SDKs to send a partial browser context with only user-agent, and have relay infer the rest of the data from this, if it exists (instead of from event.request).

@mydea mydea requested review from cleptric, lforst and a team April 2, 2025 14:02
@mydea mydea self-assigned this Apr 2, 2025
Copy link

vercel bot commented Apr 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2025 2:06pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Apr 2, 2025 2:06pm
sentry-docs ⬜️ Ignored (Inspect) Apr 2, 2025 2:06pm

Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

sgtm. Before we merge this we should actually implement this in Relay.

@mydea
Copy link
Member Author

mydea commented Apr 2, 2025

After talking with @Dav1dde we will actually not do that, because it is hard for relay to partial-update contexts. Instead, relay can use the user-agent from the browser envelope request itself, which should already be here - which is great, because it means the SDK does not need to do/send anything 💪

@mydea mydea closed this Apr 2, 2025
@lforst
Copy link
Member

lforst commented Apr 3, 2025

After talking with @Dav1dde we will actually not do that, because it is hard for relay to partial-update contexts. Instead, relay can use the user-agent from the browser envelope request itself, which should already be here - which is great, because it means the SDK does not need to do/send anything 💪

Scary. In the case of tunneling this information is lost. "Hard for relay to partially update contexts" also seems a bit ridiculous.

Copy link
Member

@cleptric cleptric left a comment

Choose a reason for hiding this comment

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

We actually need to figure out how this will be handled in Relay fist.

  • If there is no browser context, Relay creates one
  • How does the presence of a user_agent fit in in the current behavior
  • How do we merge partial context

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