mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

No manager found with ID across different AnnotationManagers on iOS

Open mvarendorff2 opened this issue 1 year ago • 4 comments

Recently we found these logs in Sentry:

PlatformException: PlatformException(0, No manager found with id: 2AD7C, null, null)
  File "polyline_annotation_messager.dart", line 313, in _PolylineAnnotationMessager.create
  File "<asynchronous suspension>"

the id obviously varying between entries

The calls we recorded these errors on are _PolylineAnnotationManager.create, _PointAnnotationManager.create and _PointAnnotationManager.createMulti.

I have been digging like a maniac but I could not find out why these errors would exist in the first place; we are not calling map.annotations.removeAnnotationManager anywhere in our code, so by my understanding, there shouldn't be a reason a manager should ever be removed from the dict here in the first place:

https://github.com/mapbox/mapbox-maps-flutter/blob/338a45121472e7ad83a7b2ac173b18a1d900ac05/ios/Classes/AnnotationController.swift#L33-L35

I also noticed that the error message does not seem to differ between "not finding the manager" and "something else going wrong" here:

https://github.com/mapbox/mapbox-maps-flutter/blob/338a45121472e7ad83a7b2ac173b18a1d900ac05/ios/Classes/PointAnnotationController.swift#L14-L26

I am unfortunately in a bit of a pickle since I cannot myself reproduce the error locally; otherwise I would have done more digging myself. I have also messaged the user if he can reproduce this reliably; if so, I am going to send him a version with an attempt at better error tracing embedded so I can hopefully provide more information then.

mvarendorff2 avatar Jul 04 '23 14:07 mvarendorff2

He could reproduce this reliably and having updated some of the error logging to this:

https://github.com/mapbox/mapbox-maps-flutter/blob/bae33337fd96882d897c242f9583e418ebb93893/ios/Classes/PointAnnotationController.swift#L42-L44

it turns out that indeed, the ControllerDelegate appears to lose track of the annotationmanager; the full error now is:

PlatformException(0, No manager found with id: FAD82, caught error: mapbox_maps_flutter.AnnotationControllerError.noManagerFound, description: The operation couldn’t be completed. (mapbox_maps_flutter.AnnotationControllerError error 0.), null, null)

Any leads on how to fix this are much appreciated!

mvarendorff2 avatar Jul 10 '23 07:07 mvarendorff2

Our current workaround is to remove all annotation managers and recreate them (to maintain their order, see #37) whenever we call any create / createMulti which seems quite excessive. We could reproduce the error on an iPhone 7 with iOS 14 at long last but unfortunately lack the resources to further debug this issue atm.

mvarendorff2 avatar Aug 10 '23 05:08 mvarendorff2

The problem seems to still be happening with the current version, we are also experiencing the same issue. The workaround is kinda icky, since it causes a short flicker of the polyline everytime it is updated.

lukaskurz avatar Feb 24 '24 16:02 lukaskurz

any update ..?

fodedoumbouya avatar Jun 20 '24 15:06 fodedoumbouya