mapbox-gl-native-android icon indicating copy to clipboard operation
mapbox-gl-native-android copied to clipboard

notifications not dismissible when downloads are begun in parallel

Open sbma44 opened this issue 5 years ago • 0 comments

When two downloads are begun simultaneously, only one of the status notification elements is dismissed, even though callbacks fire for both and the data appears to be completely received. This superficially sounds like a classic race condition (perhaps the callback passes an index that shifts as the notifications get dismissed?).

The following applies to 9.3 of the SDK

To download one of our maps that contains a line we start two mapbox downloads at the same time. One is an OfflineTilePyramidRegionDefinition covering the area from zoom levels 0 to 13 and the other is a OfflineGeometryRegionDefinition covering zoom 14 to 19 with the geometry defined by the line of the route in question, to get more detail in that area.

On Android, I'm seeing that both downloads complete successfully according to the status callbacks but the ongoing notification for the second download is not dismissed. It appears that whichever one finishes second is the notification that remains. The notification is not interactive at this point and clicking cancel on it has no effect and does not appear to trigger the canceled status call. The notification cannot be swiped away (since it is an ongoing service notification). It is not dismissed if the AllTrails app is swiped away. Force stopping the app is the only way I have found to dismiss the notifications.

On re-launch, the Mapbox SDK does appear to have the correct state of the offline packs.

sbma44 avatar Jan 08 '21 17:01 sbma44