Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Malformed userAgent in telemetry events #4328

Closed

Description

@camilleanne

Seeing events come into staging that look like:
{"event":"appUserTurnstile","created":"2016-03-14T20:46:23.676Z","userId":"{userId}","enabled.telemetry":true,"received":"2016-03-14T20:46:24.359Z","token":"{token}","owner":"bleege","authorization":"{auth}","userAgent":"Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 Mapbox GL/4.0.0/8 MapboxEventsAndroid/4.0.0-SNAPSHOT","version":2,"createdOffset":"+0100"}

cc @bleege

Activity

  1. added
    Android
    telemetry
    on Mar 15, 2016
  2. added this to the android-v4.0.0 milestone on Mar 15, 2016
  3. self-assigned this
    on Mar 15, 2016
  4. bleege commented on Mar 15, 2016

    @bleege
    Contributor

    Good catch @camilleanne. I'll fix this.

  5. bleege commented on Mar 18, 2016

    @bleege
    Contributor

    Initial inspection seems to indicate a regression due to #4263 and specifically b372bb2d823a397fbfa98317d8c581de93063065.

  6. bleege commented on Mar 18, 2016

    @bleege
    Contributor

    Also appears to be related to #2816 and 94c5c2e. initialise() may be being called multiple times due to rotation that the previous solo null check on savedInstanceState was being used to avoid.

    /cc @tobrun

  7. added a commit that references this issue on Mar 18, 2016
  8. bleege commented on Mar 18, 2016

    @bleege
    Contributor

    Added an explicit if (savedInstanceState == null) check before configuring MapboxEventManager to prevent the multiple initialization and subsequent repeated strings in the User Agent when the device is rotated. Will merge to master and then cherry pick to the release-ios-3.2.0-android-4.0.0 branch.

  9. added a commit that references this issue on Mar 18, 2016
  10. bleege commented on Mar 18, 2016

    @bleege
    Contributor

    Merged and cherry picked!

    screen shot 2016-03-18 at 5 27 07 pm

    /cc @jfirebaugh

  11. tobrun commented on Mar 21, 2016

    @tobrun
    Member

    @bleege
    Changes should be reviewed before going on to the release branch?

    While the savedInstanceState==null check solves it for most use-cases it will not for all:

    • Having maps in multiple activities in one application
    • User doesn't override onSaveInstanceState and thus not having a savedState when recreating.
    • User shows 2 Mapviews in one screen.

    The fix in d33cee7 works around the issue, it doesn't solve the real issue of having a malformed user agent. When you cal initialise on a Singleton it should always produce the same outcome.

  12. reopened this on Mar 21, 2016
  13. added a commit that references this issue on Mar 21, 2016
  14. bleege commented on Mar 21, 2016

    @bleege
    Contributor

    Good catch @tobrun! I've just added a state check to userAgent that will further ensure that it only gets set once. Can you 👀 to make sure that it addresses the concerns that you're thinking about?

  15. added 2 commits that reference this issue on Mar 21, 2016
  16. bleege commented on Mar 21, 2016

    @bleege
    Contributor

    Merged to master via 16a58e8 and cherry picked to release-ios3.2.0-android-4.0.0.

    screen shot 2016-03-21 at 3 09 48 pm

    /cc @jfirebaugh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Androidbugtelemetry

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions