Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps should update automatically based on internet connection changes #994

Open
achou11 opened this issue Feb 25, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@achou11
Copy link
Member

achou11 commented Feb 25, 2025

Describe the bug

If you open the app while internet is disconnected and then it becomes connected, the map does not update to reflect the online map style. You have to restart the app in order for the map to show.

Context for why this happens:

We proxy the StyleJSON URL using a embedded http server that runs as part of the app. As part of this proxying, we dynamically provide different StyleJSON responses based the success of a preliminary http request to the relevant URLs. So at the time of when we request the StyleJSON to use for the mapping library, if the internet connection is unavailable when attempting to make the upstream online style request, we serve the StyleJSON for the offline fallback map and the mapping library uses that to make requests for tiles and other assets.

At the moment, we don't attempt re-request the StyleJSON response to use from the proxy upon internet connection changes, meaning that once the internet connection is available again, the mapping library still uses the StyleJSON that's associated with the offline fallback map.

To Reproduce

  1. Fresh install
  2. Turn off internet connection (e.g turn on airplane mode)
  3. Open app
  4. Turn on internet connection (e.g. turn off airplane mode)

Expected behavior

Ideally after (4), the map should refresh such that you're no longer viewing the fallback offline map and instead viewing the default online map style.

A note for potential implementers: while I think it's clear what the desired behavior is when going from disconnected to connected, I think we do not want to apply the inverse in the case of going from connected to disconnected i.e. if you open the app while connected to internet and then you become disconnected, we should still show as much of the online style as possible (which is mostly handled via caching in the mapping library) and not completely update the map such that it shows the offline fallback map.

Smartphone

  • Device: Pixel 6
  • OS: Android 15
@achou11 achou11 added the bug Something isn't working label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant