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

Improve user agent parsing (Sentry not always reporting UA data correctly) #788

Open
pjenvey opened this issue Aug 17, 2020 · 2 comments
Open
Labels
5 Estimate - l - Moderately complex, will require some effort but clearly defined. enhancement New feature or request

Comments

@pjenvey
Copy link
Member

pjenvey commented Aug 17, 2020

We use the generic woothee user agent parser, however our Sync clients tend to use custom UA strings that don't always parse down to useful tags (e.g. #787).

We should implement our own user agent parsing instead. Either woothee should be abandoned entirely or only used as a fallback.

@pjenvey pjenvey added enhancement New feature or request 5 Estimate - l - Moderately complex, will require some effort but clearly defined. labels Aug 17, 2020
@pjenvey pjenvey added this to Backlog: Misc in Services Engineering via automation Aug 17, 2020
@tublitzed tublitzed moved this from Backlog: Misc to Prioritized in Services Engineering Aug 17, 2020
@rfk
Copy link
Contributor

rfk commented Aug 18, 2020

Aye, unfortunately most standard UA-parsing libraries don't handle the sync UA strings well. Summary of known current client behaviour:

  • Firefox Desktop tries to send a normal-looking UA string, with some extra information about sync appended to it, see here.
  • The user-agent logic for Firefox for iOS lives here; it tries to send a fairly usual-looking UA string but prepends a unique token like "Firefox-iOS-Token" or "Firefox-iOS-Sync" depending on what service it's trying to access.
    • However! For reasons, requests from Firefox for iOS that originate in the shared rust components will use a hard-coded user-agent string of Firefox-iOS-FxA/24.
  • Android clients all use the HTTP client library from android-components, which sets the default user-agent string to MozacFetch/${BuildConfig.LIBRARY_VERSION}; I don't believe any clients currently alter this from its default.

For unrelated reasons, I'm interested in trying to get all our clients to include additional information in their UA string, such as the release channel identifier. I think that might argue in favor of using some custom parsing to augment the off-the-shelf library.

@tublitzed tublitzed moved this from Prioritized to Backlog: Sync in Services Engineering Dec 17, 2020
@pjenvey
Copy link
Member Author

pjenvey commented May 5, 2021

More observation of the UA strings in the duplicate #1027, such as this comment

@pjenvey pjenvey changed the title Improve user agent parsing Improve user agent parsing (Sentry not always reporting UA data correctly) May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 Estimate - l - Moderately complex, will require some effort but clearly defined. enhancement New feature or request
Projects
Services Engineering
  
Backlog: Sync
Development

No branches or pull requests

2 participants