-
Notifications
You must be signed in to change notification settings - Fork 58
fix(analytics-browser): diagnostics track user agent (#1428) #1436
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
base: feat-zoning-1211
Are you sure you want to change the base?
fix(analytics-browser): diagnostics track user agent (#1428) #1436
Conversation
|
Integration tests failed probably because some mocks in tests are not picked up in this feature branch. Hold this PR until they are solved |
|
Can we keep this change in the original branch feat-zoning-1211-plus-diagnostics-user-agent and just pre-release that branch instead? Alvin may need to continue to work on feat-zonging-1211 when he's back |
This reverts commit e01f0dd.
Track browser user agent in diagnostics by setting
|
This reverts commit 65617cb.
| }, | ||
| ); | ||
| diagnosticsClient.setTag('library', `${LIBPREFIX}/${VERSION}`); | ||
| diagnosticsClient.setTag('user_agent', navigator.userAgent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing navigator.userAgent without a guard can crash in non‑browser contexts. Consider guarding with typeof navigator !== 'undefined' (like in Context) before setting the tag.
| diagnosticsClient.setTag('user_agent', navigator.userAgent); | |
| if (typeof navigator !== 'undefined') { | |
| diagnosticsClient.setTag('user_agent', navigator.userAgent); | |
| } |
🚀 Want me to fix this? Reply ex: "fix it for me".
Summary
Cherry pick #1428
Checklist