fix(ratewise): P0 PWA precache-first 與 CDN ETag 收斂#425
Conversation
- 移除 NAVIGATION_NETWORK_TIMEOUT_MS + Promise.race:iOS eviction 後 3s timeout
會將 offline.html 回傳給在線用戶(假離線症狀,看起來像未更新至最新版本)
- Cold start 改用 matchPrecache('index.html') 立即回傳,等同 createHandlerBoundToURL
行為且無需等待;背景同步更新 html-cache 供暖啟動使用
- ensureOfflineHtmlCached:同時備份 index.html 至 html-cache,使 index 與
offline.html 具有同等 iOS eviction 存活率
- resolveOfflineDocumentFallback 新增 matchIndexHtmlInAnyCache 第二層 fallback
測試:pwaOfflineFallback.test.ts 補齊 matchIndexHtmlInAnyCache 路徑;154 ratewise tests pass
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>
- 停止對 jsDelivr/GitHub Raw 發送 If-None-Match 條件式請求 - 移除 304 分支,保留 ETag 寫入快取供未來 Worker proxy 路徑 - 同步更新 exchangeRateService 單元測試 測試:pnpm --filter @app/ratewise test -- exchangeRateService(32 passed) Co-authored-by: Cursor <cursoragent@cursor.com>
- fetchFromCDN 不再傳入 cachedEtag,不發送 If-None-Match 標頭 - 移除 304 Not Modified 分支,改由 HTTP cache 管理重複請求 - 更新測試:驗證即使快取有 ETag 也不附帶 If-None-Match - 更新 OpenData.tsx、SeoTech.tsx、seo-metadata.ts FAQ 說明文字 - 同步更新 open-data.md Markdown mirror - AGENTS.md 補充 UI/UX 治理知識點 測試:pnpm --filter @app/ratewise test -- moneyboxRateService(passed) 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>
- 合併三個 cherry-pick changeset 為單一 patch 條目 - 更新 002 紀錄 P0 收斂策略與累計分數 測試:focused sw/exchangeRate/moneybox 53 passed;pnpm build:ratewise Co-authored-by: Cursor <cursoragent@cursor.com>
- 移除 3s timeout 舊斷言,改驗證 matchPrecache index.html - 防回歸 NAVIGATION_NETWORK_TIMEOUT_MS 重新引入 測試:sw.test.ts + pwa-offline.test.ts 65 passed Co-authored-by: Cursor <cursoragent@cursor.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9921d724a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- 寫入 Learned Preferences/Facts(PR 合併批准、銀行賣出價定位、SSOT 路徑、Zen 主色) - 002 新增 neutral-agents-continual-learning-sync 條目 測試:未執行(僅文件變更) Co-authored-by: Cursor <cursoragent@cursor.com>
- Codex P1:localStorage TTL 到期後避免 HTTP cache 回傳過期 body - 補 exchangeRateService 測試斷言 cache: 'no-cache' - 更新 changeset 描述納入 CDN 重新驗證 測試:pnpm --filter @app/ratewise test -- exchangeRateService(32 passed) Co-authored-by: Cursor <cursoragent@cursor.com>
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
|
已於 4822b84 修復 Codex P1: |
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4822b84401
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Codex P2:換錢所 TTL 到期後避免 HTTP cache 回傳過期報價 - fetchFromCDN 加 cache: 'no-cache' 並補 moneyboxRateService 測試斷言 - 更新 changeset 與 002 獎懲記錄 測試:pnpm --filter @app/ratewise test -- moneyboxRateService/exchangeRateService(48 passed) Co-authored-by: Cursor <cursoragent@cursor.com>
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4a3f87781
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
QA 複核摘要(E2E Runner / 2026-06-26)測試 SHA: 整體判定:QA FAIL(未合併)
Console 證據乾淨 Playwright context 首屏仍觸發 React #418 hydration pageerror。 截圖路徑(本機 QA 產物,未提交)
CI 狀態(HEAD commit check-runs)非 paths filter 問題。 實際根因:短時間內多次 push 造成 CI run churn + runner 卡住:
HEAD commit 目前僅關聯 CodeQL + SEO Audit(7/7 可見綠燈),缺主 CI workflow 的 Quality / E2E / Lighthouse checks。 建議修復:對 PR425 重新觸發 CI( 合併建議選項 A(推薦,需 maintainer 明確 waiver) 選項 B 本輪動作:依指示 未執行 merge。待 maintainer 選 A/B 並確認 CI 重新跑完。 |
- header 由 +1 更正為 +3(reward 3、penalty 0),累計 +62 不變 - 新增 neutral-002-score-header-correction-pr425 條目 測試:未執行(僅 002 稽核欄位修正) Co-authored-by: Cursor <cursoragent@cursor.com>
QA / 合併建議
請勿在未收到明確「合併 #425」指示前自動 squash merge。 |
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
Follow-up(ab66580d 後續)已推送 commit
CI 處置
合併依 AGENTS.md 未自動 merge,待 maintainer 明確批准。 |
Summary
自 PR #411 拆分 P0 修復,僅 cherry-pick 三個 commit 至
origin/main:86c77b4a— iOS PWA precache-first 導覽(移除 3s timeout 假離線)6790b179— 移除 exchangeRate If-None-Match(避免 jsDelivr preflight 失敗)cbd116c1— 移除 moneybox CDN ETag 請求,更新 OpenData / SeoTech 說明刻意排除:split-meow、ci.yml revert、AppLayout 移除 PwaInstallGuide 等無關變更。
Changeset(patch):離線導覽更快、匯率不再因 ETag 304 卡住。
Cherry-pick 衝突處理
offline.html:採 cherry-pick 版(主題感知 + viewport-fit)exchangeRateService.ts/OpenData.tsx:採 ETag 修復文案AGENTS.md:保留 main,不納入 PR411 治理段落漂移Test plan
pnpm --filter @app/ratewise test(pre-push 全 suite pass)pwaOfflineFallback/exchangeRateService/moneyboxRateService(53 passed)pnpm build:ratewisesw.test.ts+pwa-offline.test.ts對齊 precache-first 守門測試Made with Cursor