Sometimes due to the asynchrony the loading order was not correct. There was happening something like this:
Valid loading order. As usual:
AppData.initStart()
AppData.readSettings()
AppData.initFinish()
MapVC.init(AppData.zoom)
AppData.setZoom(MapVC.zoom)
Invalid loading order. Not very often:
AppData.initStart()
MapVC.init(AppData.zoom) // MapVC inited with not inited AppData.zoom value (1)
AppData.readSettings()
AppData.setZoom(MapVC.zoom) // Inited AppData.zoom value is rewriting with invalid MapVC.zoom value
AppData.initFinish()
Added some checks to stop this bad loop. And to handle loading if invalid case appear. Now it looks well.
The effect of the bug has been fixed, but not the cause. The cause needs to be understood and fixed.
Please attach OsmAnd log file when MapVC is inited wrong way.
issue 1 issue 2
Found and fixed some async bugs.
Sometimes due to the asynchrony the loading order was not correct. There was happening something like this:
Added some checks to stop this bad loop. And to handle loading if invalid case appear. Now it looks well.