Skip to content

fix(ratewise): 修復 Threads Barcelona UA 內建瀏覽器偵測#490

Merged
s123104 merged 1 commit into
mainfrom
fix/pwa-cold-start-threads-ua
Jun 27, 2026
Merged

fix(ratewise): 修復 Threads Barcelona UA 內建瀏覽器偵測#490
s123104 merged 1 commit into
mainfrom
fix/pwa-cold-start-threads-ua

Conversation

@s123104

@s123104 s123104 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Threads in-app browser:2024+ Threads 內建瀏覽器 UA 改用 Meta 內部代號 Barcelona(不再含 Threads 字串),導致 pwaInstallGuide 偵測失敗、PWA 安裝指引與右上角動畫不顯示
  • Cold start:main v2.25.7 已含 fix(ratewise): 修復冷啟動 multi 還原 hydration 未觸發 #488 hydration fallback;本 PR 未改 cold start 邏輯,僅確認相關測試 32 項通過

Root cause

議題 根因
Threads 偵測 IN_APP_BROWSER_PATTERNS 僅匹配 \bThreads\b,production UA 為 Barcelona 431.x(whatmyuseragent.com / udger)
Cold start 已在 #488 修復(queueMicrotask + store subscribe fallback);main 無 regression

Changed files

  • apps/ratewise/src/utils/pwaInstallGuide.ts — 補 Barcelona token
  • apps/ratewise/src/utils/__tests__/pwaInstallGuide.test.ts — iOS/Android production UA
  • apps/ratewise/src/components/__tests__/PwaInstallGuide.test.tsx — Barcelona 動畫指引
  • .changeset/threads-barcelona-inapp-ua.md — patch bump
  • docs/dev/002_development_reward_penalty_log.md

Test plan

  • pnpm --filter @app/ratewise test -- pwaInstallGuide PwaInstallGuide coldStartRestore RememberedHomeRoute(32 passed)
  • pnpm --filter @app/ratewise typecheck
  • pre-push:typecheck + test + build:ratewise(本地已跑過)
  • CI green
  • Production:Threads 內開連結 → 1.8s 後顯示「請先用外部瀏覽器開啟」+ 右上角動畫
  • Production:PWA 冷啟動 multi 偏好仍導向 /multi/

Production verification (post-merge)

  1. Release merge + deploy 完成後,在 Threads app 內開 https://app.haotool.org/ratewise/
  2. 確認右上角 inapp-corner-pointer 動畫與安裝指引 dialog 出現
  3. PWA 已安裝且 localStorage['ratewise-converter'].state.lastConverterView === 'multi' 時 hard reload → 應進 /multi/

Notes

Made with Cursor

- pwaInstallGuide SSOT 補 Barcelona token(2024+ Threads 內建瀏覽器 UA)
- 新增 iOS/Android production UA 單元測試與 PwaInstallGuide 動畫指引覆蓋

測試:ratewise 目標測試 32 項通過、typecheck 通過

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 c24f666 into main Jun 27, 2026
33 checks passed
@s123104 s123104 deleted the fix/pwa-cold-start-threads-ua branch June 27, 2026 17:28
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