Skip to content

Service Worker Fallback#1417

Merged
Nick (ingalls) merged 6 commits into
mainfrom
service-worker
Apr 23, 2026
Merged

Service Worker Fallback#1417
Nick (ingalls) merged 6 commits into
mainfrom
service-worker

Conversation

@ingalls
Copy link
Copy Markdown
Member

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the frontend service worker lifecycle to reduce “stale cache” breakages, improve offline navigation fallback, and make update activation safer across multiple tabs.

Changes:

  • Refactors sw.js precache to be atomic, follow dynamicImports transitively, avoid caching raw .html, and add guarded cache purging + narrow runtime caching.
  • Adjusts update flow so only the tab that clicked “Update Now” auto-reloads on controllerchange; other tabs get a prompt.
  • Updates MapLibre sprite URL parsing to handle URL-normalized sprite URLs; bumps maplibre-gl to 5.24.0.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
api/web/src/test/sw.spec.ts Expands SW unit tests for install atomicity, entry-path HTML mapping, activate guard behavior, runtime caching, and offline navigation fallback.
api/web/src/stores/modules/icons.ts Updates sprite protocol regex to support MapLibre URL normalization and @2x variants.
api/web/src/main.ts Replaces “wipe all caches/unregister SW” recovery with targeted cache eviction + SW update check, guarded per tab-session.
api/web/src/base/service-worker.ts Adds per-tab “update requested” flag; uses updateViaCache: 'none'; changes controllerchange behavior to avoid reloading other tabs.
api/web/src/App.vue Marks the current tab as the update initiator before posting SKIP_WAITING.
api/web/public/sw.js Implements manifest traversal with dynamicImports, entry-shell mapping, atomic precache, guarded old-cache purge, narrow runtime caching, and offline navigation fallback.
api/web/package.json Bumps maplibre-gl from 5.23.0 to 5.24.0.
api/web/package-lock.json Updates lockfile for the maplibre-gl bump (and transitive deps) and package version.
api/lib/limits.ts Raises LimitAll maximum from 100 to 1000 (but description currently still states 100).
Files not reviewed (1)
  • api/web/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/lib/limits.ts Outdated
Comment thread api/web/src/base/service-worker.ts Outdated
Comment thread api/web/public/sw.js Outdated
@ingalls Nick (ingalls) temporarily deployed to cotak-staging April 23, 2026 18:50 Inactive
@ingalls Nick (ingalls) temporarily deployed to cotak-staging April 23, 2026 19:16 Inactive
@ingalls Nick (ingalls) temporarily deployed to cotak-staging April 23, 2026 19:43 Inactive
@ingalls Nick (ingalls) merged commit 3c899d6 into main Apr 23, 2026
15 checks passed
@ingalls Nick (ingalls) deleted the service-worker branch April 23, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants