mirror of
https://github.com/penpot/penpot.git
synced 2026-03-20 01:13:41 +00:00
✨ Add protection for stale cache of js assets loading issues (#8638)
* ✨ Use update-when for update dashboard state This make updates more consistent and reduces possible eventual consistency issues in out of order events execution. * 🐛 Detect stale JS modules at boot and force reload When the browser serves cached JS files from a previous deployment alongside a fresh index.html, code-split modules reference keyword constants that do not exist in the stale shared.js, causing TypeError crashes. This adds a compile-time version tag (via goog-define / closure-defines) that is baked into the JS bundle. At boot, it is compared against the runtime version tag from index.html (which is always fresh due to no-cache headers). If they differ, the app forces a hard page reload before initializing, ensuring all JS modules come from the same build. * 📎 Ensure consistent version across builds on github e2e test workflow --------- Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -272,7 +272,7 @@ jobs:
|
||||
- name: Build Bundle
|
||||
working-directory: ./frontend
|
||||
run: |
|
||||
./scripts/build 0.0.0
|
||||
./scripts/build
|
||||
|
||||
- name: Store Bundle Cache
|
||||
uses: actions/cache@v4
|
||||
|
||||
Reference in New Issue
Block a user