fix: version MapLibre worker assets to prevent stale cache mismatches - #79
Merged
Merged
Conversation
christopherjnelson
marked this pull request as ready for review
October 3, 2026 00:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sdfPatternsand throws while renderingdevelopment-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-lockfilepnpm validate— formatting, lint, types, 273 tests, and builds passedpnpm test:e2e— all 3 browser tests passedAll validation used offline/scripted providers. The owner requested this fix PR and its merge so the change can be tested from
main.