WSDOT / HATS

Highway Activity Tracking System Issue Tracker
6 stars 0 forks source link

Reload online basemaps after map sync #1202

Closed ReedHunter-Wsdot closed 5 years ago

ReedHunter-Wsdot commented 5 years ago

During a map sync the map is completely removed and recreated in case the sync pulled down any map schema changes. If Hats was displaying an online basemap, that's not currently loaded when the map is rebuilt. As a result, if the user picked an online basemap and then synced, no basemap at all would be displayed. The offline basemap is still there and is fine, but it's turned off to make way for the online basemap that never reloaded.

This bugfix will be to honor the online basemap choice after a map sync.

jhudsonWA commented 5 years ago

Give it a look after we ship 4.0. We can always do a small bug fix release in a couple of weeks (4.1) if anything else is found.

ReedHunter-Wsdot commented 5 years ago

This is now fixed.

The slower load of an online layer during startup also revealed an asynchronous race condition crash that is fixed too. The Map normally wins the startup race vs the Toc, but the online basemap layer slowed it down to where the Toc tried to start first and crashed Hats. I changed this to now force the Toc to wait until the map is done loading.

Test scenarios I used to confirm the fixes were ... 1) switch to an online basemap, restart Hats, confirm the online basemap was used by default at startup, confirm it showed as the selected option in the basemap picker. 2) switch on an online basemap, map sync Hats, confirm the online basemap was used again after sync, confirm the basemap picker showed the right selection. 3) switch to an online basemap, switch to airplane mode to disconnect from the internet, check the basemap picker to confirm offline map was the only option, 4) switch to an online basemap, switch to airplane mode to disconnect from the internet, restart Hats and confirm the offline basemap loads