From 74e4e98a39f40eaac6368d51fe53d24f102c7df6 Mon Sep 17 00:00:00 2001 From: haotool Date: Sun, 28 Jun 2026 16:54:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(ratewise):=20offline.html=20=E5=85=A7?= =?UTF-8?q?=E5=B5=8C=20SW=20=E8=87=AA=E6=88=91=E4=BF=AE=E5=BE=A9=E6=89=93?= =?UTF-8?q?=E7=A0=B4=E6=AD=BB=E4=BA=A1=E8=BF=B4=E5=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在線卻載入 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 --- .../ratewise-offline-shell-self-heal.md | 5 + apps/ratewise/public/offline.html | 163 ++++++++++++++++-- .../scripts/templates/offline.template.html | 163 ++++++++++++++++-- apps/ratewise/src/pwa-offline.test.ts | 16 +- .../dev/002_development_reward_penalty_log.md | 7 +- 5 files changed, 325 insertions(+), 29 deletions(-) create mode 100644 .changeset/ratewise-offline-shell-self-heal.md diff --git a/.changeset/ratewise-offline-shell-self-heal.md b/.changeset/ratewise-offline-shell-self-heal.md new file mode 100644 index 000000000..ad4bd5e30 --- /dev/null +++ b/.changeset/ratewise-offline-shell-self-heal.md @@ -0,0 +1,5 @@ +--- +'@app/ratewise': patch +--- + +在線卻卡在離線頁時,offline.html 會自動嘗試修復 Service Worker 並導回主應用,避免無法進入主功能的死亡迴圈。 diff --git a/apps/ratewise/public/offline.html b/apps/ratewise/public/offline.html index 1594b5972..6c6ff95c8 100644 --- a/apps/ratewise/public/offline.html +++ b/apps/ratewise/public/offline.html @@ -193,7 +193,7 @@

您目前處於離線狀態

請檢查您的網路連線,或稍後再試。HaoRate 會在連線恢復時自動更新。

-