here-sdk-examples icon indicating copy to clipboard operation
here-sdk-examples copied to clipboard

Android Navigate SDK: MapUpdater

Open romandanylyk opened this issue 3 years ago • 2 comments

I've noticed a pretty weird MapUpdater behavior.

See, once I download maps and update them to the latest version via MapUpdater.performMapUpdate, the MapUpdater will keep saying that there are updates available, even tho I just made an update. Meaning MapUpdater.checkMapUpdate is always returning MapUpdateAvailability.AVAILABLE for some reason.

Once I try to perform a map update again via MapUpdater.performMapUpdate it will return (after a few seconds) onComplete with MapLoaderError = null, meaning the update is successfully complete, even if there was no update at all.

There is another issue with disposing of the HereSDK while MapUpdater performs a non-existing update. The MapUpdater.performMapUpdate is async call, and while I try to close the app while it is happening and disposing of HERE SDK in activity's onDestroy, the onComplete is not immediately called, but by HERE SDK documentation - it is supposed to.

Screen Shot 2022-09-12 at 11 08 22

As a result, it leads to the following issue: while disposing HERE SDK at a time the MapUpdater is performing a non-existing map update, HERE SDK could not be recreated by launching the app again until onComplete is called. Meaning the main thread will be blocked until MapUpdater finishes its work.

The issue could be easily reproduced in the OfflineMaps example project. HERE SDK v.4.12.2.0.9350

romandanylyk avatar Sep 12 '22 08:09 romandanylyk

Thanks for reporting. We track this on our end with #14606 and #14607.

HERE-SDK-Support-Team avatar Sep 12 '22 08:09 HERE-SDK-Support-Team

Ok good, looking forward to resolving these. Thanks.

romandanylyk avatar Sep 12 '22 08:09 romandanylyk

We verified the following expected behavior: When shutting down and calling dispose of SDKNativeEngine, all pending requests are cancelled immediately. When restating the app, it is not blocked.

On top, after an update has been installed, checkMapUpdate() now indicates no update.

HERE-SDK-Support-Team avatar Dec 09 '22 17:12 HERE-SDK-Support-Team

Great, Which version of navigate SDK contains the fix?

romandanylyk avatar Dec 09 '22 17:12 romandanylyk

HERE SDK 4.12.11.0 should already contain the fix. However, our next 4.13.0.0 major release is soon to be released as well.

HERE-SDK-Support-Team avatar Dec 12 '22 10:12 HERE-SDK-Support-Team