Repository navigation
build: stamp the service worker after the public directory is recopied - #15553
Merged
diegosouzapw merged 1 commit intoOct 6, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
copyNativeAssetsAndExtraModules copies public/ again with force, which overwrites the build id that copyStaticAndPublic just wrote into sw.js. The image then ships the generic cache name, so a browser keeps the worker from the previous deploy and serves chunks that no longer exist. Stamp after that second copy. Signed-off-by: Minxi Hou <houminxi@gmail.com>
diegosouzapw
merged commit Oct 6, 2026
fdf397f
into
diegosouzapw:release/v3.8.52
44 of 51 checks passed
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.
Summary
stampServiceWorkerBuildIdruns insidecopyStaticAndPublic, butcopyNativeAssetsAndExtraModulescopiespublic/again afterwards withforce: true(thepublic directoryentry inEXTRA_MODULE_ENTRIES). That second copy overwrites the stampedsw.jswith the source file, so the image shipsconst CACHE_NAME = "omniroute-pwa-v3";with no build id.A browser compares the fetched worker's bytes against the installed one, sees no change, and keeps the worker from the previous deploy. That worker requests
/_next/static/<old build id>/, which 404s, and the dashboard stays blank on refresh.This moves the stamp to just after that second copy. Nothing after it touches
public/.Related to #15552
Test plan
/app/public/sw.jscarries the build id (omniroute-pwa-v3-<id>), where the previous image was byte-identical to the source file./sw.jsmatches.