Skip to content

fix: version MapLibre worker assets to prevent stale cache mismatches - #79

Merged
christopherjnelson merged 1 commit into
mainfrom
fix/version-maplibre-worker-assets
Oct 3, 2026
Merged

christopherjnelson merged 1 commit into
mainfrom
fix/version-maplibre-worker-assets

Conversation

@christopherjnelson

Copy link
Copy Markdown
Member

After the MapLibre 6.6.0 → 6.11.2 upgrade, existing browsers could keep the old worker files at stable URLs cached as immutable for a year. The new renderer then receives fill buckets without sdfPatterns and throws while rendering development-hex-fills. Pairing the current renderer with the previous worker reproduced the reported error.

The worker URL now includes the renderer's MapLibre package version. Its relative shared-module import stays under that versioned path. The server serves only the installed version and the two allowlisted worker files; mismatched versions return 404. Versioned assets remain immutable, while the legacy endpoints use no-store.

Route tests cover version matching, invalid versions/files, and cache headers. A browser regression intercepts the legacy URL with a stale response and verifies that the map renders using the new versioned assets. Architecture and testing docs describe the behavior. A fresh review found no blocking issues.

Validation on commit 1c1b60d:

  • pnpm install --frozen-lockfile
  • pnpm validate — formatting, lint, types, 273 tests, and builds passed
  • pnpm test:e2e — all 3 browser tests passed

All validation used offline/scripted providers. The owner requested this fix PR and its merge so the change can be tested from main.

@christopherjnelson
christopherjnelson marked this pull request as ready for review October 3, 2026 00:12
@christopherjnelson
christopherjnelson merged commit 4db2535 into main Oct 3, 2026
2 checks passed
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.

1 participant