fix(ratewise): offline.html 自我修復打破 SW 死亡迴圈#508
Merged
Conversation
- 在線卻載入 offline.html 時探針 CHECK_SHELL_PRECACHE 並 SKIP_WAITING - 重試按鈕改為導向 app shell,移除 reload 造成的 SW 循環 - 補 pwa-offline 防回歸測試與 patch changeset 測試:vitest pwa-offline/swHealth/sw.test、typecheck、build:ratewise Co-authored-by: Cursor <cursoragent@cursor.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
This was referenced Jun 29, 2026
s123104
added a commit
that referenced
this pull request
Jun 30, 2026
* fix(ratewise): RW-3 PWA manifest 主題色 SSOT 化 - manifest theme_color/background 改讀 STYLE_DEFINITIONS.zen(移除硬編 #8B5CF6/#E8ECF4) - 同步 themes.ts zen primary 99 102 241→124 58 237,修 TS↔index.css 漂移 - 離線模板主題化(需保留 #508 自我修復的高風險合併)列 RW-3b 測試:typecheck、lint、test 2516 passed、build:ratewise、zen 截圖驗證、manifest #7C3AED Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> * fix(ratewise): 軟化 seo 文案更新頻率承諾與新鮮度免責 - RW-5:seo-metadata core/currency-landing 與內容 generator 一致將「每 5 分鐘自動同步/更新」改為「約每 5 分鐘檢查更新」 - OpenData 更新頻率 FAQ 補新鮮度免責(依資料來源與 CDN 快取而定) - regenerate public mirrors/llms/api 同步;品牌定位詞「最精準」屬產品決策本支不改 測試:typecheck、lint、test 2516 passed、build:ratewise、mirrors 同步無漂移 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> * fix(ratewise): RW-6 moneybox 首爾掛牌日跨日刷新 - 加 extractSeoulSnapshotDate/shouldRefreshLatestSnapshot:rate-changed 或 date-rollover 才刷新 - 整合進 hasRateChanges;保留 main 的 needsSchemaMigration/enrichExchangeShop(紅線不取代) - 補 3 個 vitest 案例並納入 test:root(date-rollover/unchanged/rate-changed) 測試:moneybox vitest 3 passed、腳本 import 5 exports 正常、needsSchemaMigration 保留 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> * fix(ratewise): moneybox history 檔名首爾化與 sw 離線路由(rw-6b) - workflow history 檔名改用 extractSeoulSnapshotDate(資料首爾掛牌日)+ fallback 首爾 wall-clock - aggregate 首次缺失補 changed=true,避免 history-30d.json 遺失卻不開 PR - sw.ts history-30d 路由加 providers/moneybox 路徑,離線可服務換錢所趨勢圖 測試:typecheck、lint、test 2516 passed、build:ratewise(sw 編進 worker) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> * fix(ratewise): rw-3b 離線頁主題感知並保留自我修復 - 合併 PR 433 主題感知離線模板(per-theme CSS 變數 + theme-color + safe-area + viewport-fit) - 植回 main 的 PR 508 CHECK_SHELL_PRECACHE 自我修復腳本與 id=retry-btn(不取整檔避免回退死亡迴圈) - generate-offline-html 移除 prettier 並將 generated offline.html 加入 prettierignore(prebuild 禁 prettier) 測試:typecheck、lint、test 2516 passed、build、nitro 離線頁深色 020617 且 508 導回 app 驗證 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> * fix(ratewise): 對齊離線頁與 manifest 主題色 SSOT - regenerate offline.html zen violet-600 - index.html theme-color 對齊 #7C3AED - 更新 PWA E2E/unit 期望色 - 新增 offline/manifest artifact 一致性 smoke test 測試:pnpm build:ratewise、index.html.test.ts、pwa-offline.test.ts、pwa E2E theme-color Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: haotool <haotool.org@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Happy <yesreply@happy.engineering> Co-authored-by: Cursor <cursoragent@cursor.com>
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
swHealth僅在 ReactUpdatePrompt掛載後執行;在線用戶若被壞 SW 誤服offline.html,永遠載入不了主 app → 修復邏輯無法觸發。既有reload()/online重載仍走同一 SW navigation → 死亡迴圈。c5f08b8、API v2.25.10、live precache 全綠、sw.js含CHECK_SHELL_PRECACHE與index.html— 伺服器端正常,問題在 client 端舊/壞 SW 狀態。offline.html內嵌獨立自我修復腳本(無 React 依賴):連網時CHECK_SHELL_PRECACHE探針 → 壞 SW 則update+SKIP_WAITING→ 導向 app shell;重試按鈕改為同一流程,移除reload()循環。Test plan
vitestpwa-offline / swHealth / sw.test(86 passed)pnpm typecheckpnpm build:ratewise—dist/offline.html含自我修復腳本/ratewise/,若曾卡離線頁應自動跳回主 app(或點「重新載入」一次即可)手機驗證步驟(使用者)
Made with Cursor