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.

MGLMapboxMetrics registers defaults for non-Mapbox settings #1518

Closed

Description

@1ec5

At initialization, MGLMapboxEvents automatically registers defaults for every setting it finds in the host app’s Settings bundle. That’s too aggressive: Mapbox Metrics is not the only thing that a developer might want to provide settings for. The developer should be responsible for registering any non-Mapbox settings they come up with. Instead of a for loop, we should register a default for MGLMapboxMetricsEnabled and nothing more.

/cc @bleege @incanus

Activity

  1. added
    iOS
    telemetry
    on May 12, 2015
  2. added this to the iOS Beta 2 milestone on May 12, 2015
  3. incanus commented on May 12, 2015

    @incanus
    Contributor

    What's like the worst-case ramification here?

  4. 1ec5 commented on May 12, 2015

    @1ec5
    ContributorAuthor

    I don’t think it’s a big deal practically speaking, more of a principle-of-least-surprise thing. We don’t know that this code can handle complex settings bundles (with subpages and so forth) because we’ve never tested them with Mapbox GL. And if a developer happens to perform defaults registration themselves (which is best practice) but uses different defaults in code than in the bundle (not sure why, but who knows), we could clobber their registered defaults in a non-deterministic manner.

    I think we can address this technical debt easily in beta 2. It’s wholly unimportant for beta 1.

  5. bleege commented on May 12, 2015

    @bleege
    Contributor

    What's like the worst-case ramification here?

    Removing this would cause Metrics Opt Out to break. This is the loading of Settings.bundle into memory so that the checks have something to test.

    If we can find another way to do this in Beta 2 I'm all for it though.

  6. 1ec5 commented on May 12, 2015

    @1ec5
    ContributorAuthor

    Removing this would cause Metrics Opt Out to break.

    I’m only talking about modifying this code, not removing it. See what @friedbunny did in #1529, for example.

  7. bleege commented on May 12, 2015

    @bleege
    Contributor

    @1ec5 Ah, I see now. The thought is to just look explicitly for the Mapbox known keys and only load those. That makes sense to me. 👍

  8. added 2 commits that reference this issue on May 12, 2015
    835a684
    afbb9c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugiOStelemetry

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions