fix: Firefox stale-cache ReferenceError on writer pages (#151)#153
Conversation
Firefox cached shared.js from a previous firmware with max-age=86400, causing sharedWriteFlow is not defined on all writer pages. - Append ?v=1.7.0 to all shared.js and shared.css references so existing stale caches are bypassed immediately on next page load - Change Cache-Control from max-age=86400 to no-store so future firmware updates can never produce this same stale-function error again Fixes #151
Replace hardcoded ?v=1.7.0 with compile-time FIRMWARE_VERSION concatenation so the cache-bust query string automatically tracks the firmware version. Also pin espressif32@6.10.0 to prevent Arduino 3.x auto-upgrade.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThe PR implements cache-busting for static assets by appending firmware version query parameters to CSS/JS URLs across HTML templates, updates the ESP32 platform toolchain to an explicit version, and modifies Cache-Control headers for shared static assets to prevent caching. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
shared.jsfrom a previous firmware withmax-age=86400, causingsharedWriteFlow is not definedon all writer pagesCache-Controlforshared.cssandshared.jstono-store— browsers never cache these files again?v=FIRMWARE_VERSIONquery string to allshared.css/shared.jsreferences to bust existing stale caches immediately on first loadFIRMWARE_VERSIONbuild flag via C string literal concatenation — auto-updates with every release, no manual step neededespressif32@6.10.0to prevent Arduino 3.x auto-upgrade breaking the buildFixes #151
Test plan
sharedWriteFlow is not definederror?v=1.7.0appears on shared.css and shared.js referencesFIRMWARE_VERSIONin platformio.ini, rebuild — confirm version string updates in compiled HTMLSummary by CodeRabbit
Chores
Bug Fixes