Skip to content

fix(ratewise): 修復冷啟動 multi 還原 hydration 未觸發#488

Merged
s123104 merged 1 commit into
mainfrom
fix/cold-start-multi-hydration-fallback
Jun 27, 2026
Merged

fix(ratewise): 修復冷啟動 multi 還原 hydration 未觸發#488
s123104 merged 1 commit into
mainfrom
fix/cold-start-multi-hydration-fallback

Conversation

@s123104

@s123104 s123104 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 修復 SSG/CSR 生產環境下 RememberedHomeRoutehasHydrated() / onFinishHydration 未觸發而永遠卡在 hydrated=false,導致 multi 冷啟動無法還原的問題
  • hydration effect 新增 queueMicrotaskuseConverterStore.subscribe fallback:當 store 已與 localStorage persist 同步時即標記 hydrated
  • 新增 production MODE 回歸測試(hasHydrated=false 但 store 已有 lastConverterView=multi
  • patch changeset:@app/ratewise

Root cause

#487 已修復 persist/store 同步時序競態,但生產環境仍存在 zustand persist 資料已 merge、hydration callback 卻從未觸發的路徑,使 restore gate 永遠關閉。

Test plan

  • RememberedHomeRoute.test.tsx + coldStartRestore.test.ts(11 項)
  • pnpm --filter @app/ratewise test(2469 項通過)
  • CI checks green
  • 手動:PWA 冷啟動 / 上次停留 multi → 應導向 /multi

Notes

Made with Cursor

- RememberedHomeRoute 補 queueMicrotask 與 store subscribe fallback
- 新增 production MODE 回歸測試(hasHydrated=false 但 store 已同步)
- 新增 patch changeset

測試:RememberedHomeRoute + coldStartRestore 11 項通過;pnpm --filter @app/ratewise test 2469 項通過

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

@s123104 s123104 merged commit 463c39d into main Jun 27, 2026
17 checks passed
@s123104 s123104 deleted the fix/cold-start-multi-hydration-fallback branch June 27, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant