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.

Platform annotation references should reflect mbgl state #8655

Closed

Description

@boundsj

In #8163, we discovered that a series of events that includes removing annotations just as one of the removed annotations is selected can trigger assertions in MGLMapView. This is because queries of mbgl to get annotations in a rectangle return annotation tags that have already been removed from local collections that MGLMapView keeps for tracking purposes.

In #8513, #8588, and #8637 we added protections and removed code that indexed into std::map. These changes stabilized the SDK in release builds. However, debug builds may still trigger assertions because of annotation state race conditions like the one described above.

We should audit MGLMapView to understand all possible cases where state sync issues like this can occur. To truly fix the issue however, we would need some way to sync up with mbgl when annotation state has finished changing.

For example, if Map::removeAnnotation() had a way to call back when an annotation is actually removed, the platform code could hold off on changing its related state until the callback completed. If that were true, we would not expect our assertions about unknown or invalid annotations to be triggered in debug builds.

cc @1ec5 @fabian-guerra

Activity

  1. added
    Core
    iOS
    macOS
    on Apr 5, 2017
  2. added this to the ios-future milestone on Apr 5, 2017
  3. added
    archived
    on Nov 10, 2018
  4. stale commented on Nov 27, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

    CorearchivedcrashiOSmacOS

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions