ReviewOS

stacks/ts-maps

Offline: automatic updates, persistent storage and quota handling

#6255
Closed chris opened this 9 days ago ·
9 days ago

Apple keeps downloaded maps up to date automatically and warns when storage is low. OfflineMaps supports manual update(id), and nothing guards the browser storage quota.

Scope

  • Automatic updates: an opt-in autoUpdate with a maximum age. On ready(), when online (and ideally on unmetered connections, where navigator.connection says), refresh regions older than it, one at a time. Add a switch in the Offline Maps panel, as Apple has.
  • Persistence: call navigator.storage.persist() when the first region is downloaded, so the browser does not evict downloads under pressure. Show whether storage is persisted.
  • Quota: check navigator.storage.estimate() before a download. Warn in the area picker when the estimate exceeds the free space, and fail gracefully (status error, a clear message) on QuotaExceededError.
  • Automatic resume: an interrupted download currently comes back paused after a reload. Add an option to resume automatically when back online.

Sign in to comment on this issue.