@jetthai/cuora 1.1.488-dev.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/pre-commit +3 -1
- package/.prettierignore +1 -2
- package/CHANGELOG.md +0 -746
- package/README.md +15 -299
- package/package.json +3 -6
- package/resetGitBranch.sh +101 -0
- package/src/api/activity.js +39 -24
- package/src/api/auth.js +35 -4
- package/src/api/common.js +1 -8
- package/src/api/game.js +10 -0
- package/src/api/index.js +1 -3
- package/src/api/payment.js +55 -18
- package/src/api/user.js +16 -11
- package/src/index.js +2 -2
- package/src/lib/fingerprint_v3_11_12.js +11433 -0
- package/src/machine/activity/activity.js +209 -0
- package/src/machine/activity/activity_cash.js +18 -71
- package/src/machine/activity/diamond_shop_activity_cash.js +1 -0
- package/src/machine/activity/diamond_shop_activity_fc.js +196 -0
- package/src/machine/activity/diamond_shop_activity_vn.js +178 -0
- package/src/machine/activity/fafafa_activity.js +10 -0
- package/src/machine/activity/index.js +12 -0
- package/src/machine/activity/invite_friends_activity.js +114 -0
- package/src/machine/activity/mini_game_activity.js +68 -0
- package/src/machine/activity/return_bonus_activity.js +153 -0
- package/src/machine/activity/roulette_activity_v2.js +0 -5
- package/src/machine/auth.js +140 -192
- package/src/machine/auth_otp_v2.js +177 -0
- package/src/machine/auth_otp_v3.js +32 -111
- package/src/machine/bank_binding.js +2 -2
- package/src/machine/bank_binding_amb.js +145 -0
- package/src/machine/bonus.js +75 -0
- package/src/machine/common.js +91 -27
- package/src/machine/deposit/amb.js +92 -0
- package/src/machine/deposit/crypto_bank.js +325 -0
- package/src/machine/deposit/crypto_bank_cash.js +8 -19
- package/src/machine/deposit/crypto_qrcode.js +148 -0
- package/src/machine/deposit/crypto_qrcode_cash.js +41 -26
- package/src/machine/deposit/crypto_way.js +247 -0
- package/src/machine/deposit/crypto_way_cash.js +32 -52
- package/src/machine/deposit/deposit_fc.js +271 -0
- package/src/machine/deposit/direct.js +310 -0
- package/src/machine/deposit/direct_cash.js +9 -8
- package/src/machine/deposit/float.js +374 -0
- package/src/machine/deposit/index.js +28 -0
- package/src/machine/deposit/krway.js +151 -0
- package/src/machine/deposit/loadcard_cash.js +31 -14
- package/src/machine/deposit/loadcard_vn.js +351 -0
- package/src/machine/deposit/manual_cash.js +10 -8
- package/src/machine/deposit/manual_vn.js +458 -0
- package/src/machine/deposit/qrcode_cash.js +30 -14
- package/src/machine/deposit/qrcode_v2.js +338 -0
- package/src/machine/deposit/usdt.js +144 -0
- package/src/machine/deposit/virtual_bank_cash.js +2 -5
- package/src/machine/deposit/virtual_bank_vn.js +269 -0
- package/src/machine/deposit/vpay.js +367 -0
- package/src/machine/error.js +0 -7
- package/src/machine/game_hot_new.js +79 -0
- package/src/machine/game_info.js +12 -5
- package/src/machine/game_replay.js +46 -0
- package/src/machine/game_search_v2.js +401 -0
- package/src/machine/game_v2_1.js +88 -58
- package/src/machine/honor_board.js +132 -0
- package/src/machine/honor_board_cash.js +18 -15
- package/src/machine/inbox.js +12 -0
- package/src/machine/index.js +32 -0
- package/src/machine/leaderboard.js +11 -8
- package/src/machine/merge.js +57 -0
- package/src/machine/payment_data.js +86 -0
- package/src/machine/promotions.js +170 -0
- package/src/machine/ranking.js +25 -43
- package/src/machine/reward.js +255 -0
- package/src/machine/reward_cash.js +41 -2
- package/src/machine/reward_fc.js +98 -0
- package/src/machine/roulette_v2.js +25 -20
- package/src/machine/side.js +154 -0
- package/src/machine/side_cash.js +2 -3
- package/src/machine/side_v2.js +209 -0
- package/src/machine/user_reset_password.js +15 -4
- package/src/machine/user_sign_up.js +60 -49
- package/src/machine/vip_table.js +57 -0
- package/src/machine/websocket.js +325 -378
- package/src/machine/welcome.js +110 -0
- package/src/machine/withdraw/index.js +6 -0
- package/src/machine/withdraw/withdraw_crypto_cash.js +327 -0
- package/src/machine/withdraw/withdraw_krway.js +222 -0
- package/src/machine/withdraw/withdraw_manual.js +533 -0
- package/src/machine/withdraw/withdraw_manual_cash.js +43 -74
- package/src/request/config.js +0 -2
- package/src/request/request.js +64 -231
- package/src/util/constant.js +2 -12
- package/src/util/deviceToken.js +59 -0
- package/src/util/index.js +4 -2
- package/src/util/math.js +4 -0
- package/.claude/commands/sync-ai-prompts.md +0 -180
- package/.claude/settings.local.json +0 -25
- package/.github/copilot-instructions.md +0 -459
- package/.husky/post-checkout +0 -32
- package/.husky/pre-push +0 -36
- package/AGENTS.md +0 -459
- package/AI_PROMPT_SOURCE.md +0 -457
- package/CLAUDE.md +0 -459
- package/GEMINI.md +0 -459
- package/docs/kibana/crypto-way-deposit-amount-bug-analysis.md +0 -1003
- package/docs/kibana/play-providerId-error.md +0 -202
- package/docs/kibana/play-selectedWalletType.md +0 -1
- package/docs/kibana/play-selectedWalletType_2.md +0 -1
- package/docs/kibana/play-selectedWalletType_analysis.md +0 -565
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/branch-transfer.md +0 -14
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/cash-module-preparation.json +0 -40
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/cash-module-verification.md +0 -41
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/implementation-ledger.md +0 -87
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/module-report.md +0 -73
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/plan.md +0 -309
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/test-cases.md +0 -245
- package/docs/my-claude/feat-sharon-JT-1791180540-onesignal/transfer.md +0 -9
- package/e2e/feature-map.md +0 -19
- package/prepare-for-pr/JT-1776243420.md +0 -85
- package/prepare-for-pr/TI-16026/STATE.md +0 -18
- package/prepare-for-pr/TI-16026/after-prepare-authorization.md +0 -3
- package/prepare-for-pr/TI-16026/analysis.md +0 -38
- package/prepare-for-pr/TI-16026/answer-analyze-01.md +0 -1
- package/prepare-for-pr/TI-16026/answer-commit-01.md +0 -2
- package/prepare-for-pr/TI-16026/answer-commit-02.md +0 -1
- package/prepare-for-pr/TI-16026/bundle.json +0 -18
- package/prepare-for-pr/TI-16026/checklist.md +0 -196
- package/prepare-for-pr/TI-16026/checklist.unit-test-original.md +0 -39
- package/prepare-for-pr/TI-16026/claude-after-model +0 -1
- package/prepare-for-pr/TI-16026/claude-commit-session +0 -1
- package/prepare-for-pr/TI-16026/claude-harvest-session +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/01-analyze.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/01-analyze.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/02-analyze.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/02-analyze.out +0 -4
- package/prepare-for-pr/TI-16026/claude-hops/03-dev.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/03-dev.out +0 -4
- package/prepare-for-pr/TI-16026/claude-hops/04-dev.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/04-dev.out +0 -4
- package/prepare-for-pr/TI-16026/claude-hops/05-dev.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/05-dev.out +0 -3
- package/prepare-for-pr/TI-16026/claude-hops/06-after.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/06-after.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/07-commit.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/07-commit.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/08-commit.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/08-commit.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/09-commit.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/09-commit.out +0 -8
- package/prepare-for-pr/TI-16026/claude-hops/10-harvest.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/10-harvest.out +0 -3
- package/prepare-for-pr/TI-16026/claude-hops/11-harvest.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/11-harvest.out +0 -3
- package/prepare-for-pr/TI-16026/commit-note.md +0 -5
- package/prepare-for-pr/TI-16026/evidence-index.json +0 -215
- package/prepare-for-pr/TI-16026/feature-map.before.md +0 -61
- package/prepare-for-pr/TI-16026/harvest-redaction.json +0 -34
- package/prepare-for-pr/TI-16026/harvest-redaction.out +0 -37
- package/prepare-for-pr/TI-16026/harvest.md +0 -46
- package/prepare-for-pr/TI-16026/lessons.md +0 -5
- package/prepare-for-pr/TI-16026/note-harvest-redaction.md +0 -1
- package/prepare-for-pr/TI-16026/open-questions.md +0 -6
- package/prepare-for-pr/TI-16026/publish.md +0 -32
- package/prepare-for-pr/TI-16026/review-convergence-response.md +0 -3
- package/prepare-for-pr/TI-16026/review-input/scope.md +0 -18
- package/prepare-for-pr/TI-16026/review-log.md +0 -57
- package/prepare-for-pr/TI-16026/review-notes.md +0 -97
- package/prepare-for-pr/TI-16026/review-response-r1.md +0 -7
- package/prepare-for-pr/TI-16026/self-test-report.md +0 -67
- package/prepare-for-pr/TI-16026/spec-proposal.md +0 -34
- package/prepare-for-pr/TI-16026/spec-snapshot.md +0 -291
- package/prepare-for-pr/TI-16026/state-log.md +0 -57
- package/prepare-for-pr/TI-16026/user-messages/01.md +0 -12
- package/prepare-for-pr/TI-16026/user-messages/02.md +0 -20
- package/prepare-for-pr/TI-16026/user-messages/03.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/04.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/05.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/06.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/07.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/08.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/09.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/10.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/11.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/12.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/13.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/14.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/15.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/16.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/17.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/18.md +0 -10
- package/prepare-for-pr/TI-16026/user-messages/19.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/20.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/21.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/22.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/23.md +0 -8
- package/prepare-for-pr/TI-16026/user-messages/24.md +0 -24
- package/prepare-for-pr/TI-16026/user-question.md +0 -24
- package/prepare-for-pr/TI-16026/verify/metrics-check.json +0 -13
- package/prepare-for-pr/TI-16026/verify/redaction.json +0 -38
- package/prepare-for-pr/TI-16026/verify/row-closure.json +0 -45
- package/prepare-for-pr/TI-16026/verify/s04-ws-capture.md +0 -23
- package/prepare-for-pr/TI-16026/verify-after.md +0 -23
- package/prepare-for-pr/TI-16026/verify.json +0 -80
- package/prepare-for-pr/TI-16026.md +0 -408
- package/scripts/auto-version.js +0 -69
- package/scripts/auto-version.sh +0 -33
- package/scripts/branch-auto-npm-publish.js +0 -36
- package/scripts/check-version.sh +0 -36
- package/scripts/clean-tags.sh +0 -84
- package/src/api/account.js +0 -7
- package/src/api/otp.js +0 -5
- package/src/util/amount.js +0 -8
- package/src/util/err998SentryExtra.js +0 -26
- package/src/util/paramStore.js +0 -139
- package/src/util/socketPolicy.js +0 -57
- package/src/util/tokenStore.js +0 -44
- package/test/auth_otp_v3.test.js +0 -323
- package/test/auth_self_timeout.test.js +0 -171
- package/test/request_self.test.js +0 -288
- package/test/withdraw_manual_cash.test.js +0 -149
- package/tests/session.test.mjs +0 -177
- package/tests/websocket.test.mjs +0 -779
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
# 測試案例:WebSocket 連線契約遷移(三端)
|
|
2
|
-
|
|
3
|
-
**票號**:`JT-1790247240`;來源為使用者提供的 Notion Issue Id 截圖。
|
|
4
|
-
**文件狀態**:PWA/SSR 已完成;cash/cuora 程式及候選包整合完成,正式 cash SDK 升版待修正版發布,真實環境驗收未執行。
|
|
5
|
-
**本次測試範圍**:僅 PWA/SSR policy、socket 生命週期、推送與 REST 消費;cash/cuora 原計畫保留供後續,這次不實作或驗證。
|
|
6
|
-
**需求與步驟**:[plan.md](plan.md)。**歷史 case 表的端對端/真實環境均未執行;已執行的自動化結果另列於本文件末尾**。mock 通過不能當作正式部署驗收。
|
|
7
|
-
|
|
8
|
-
## 環境、資料與可用命令
|
|
9
|
-
|
|
10
|
-
- 資料以測試帳號、替代 token A/B、虛構 order A/B、messageId M1/M2 為主;不要把實際 token、uidSite、金流個資存入截圖、HAR、文件或 log。測試注入僅在一次性 mock/harness;不新增正式 token 覆寫後門。
|
|
11
|
-
- 三端開始後先固定 release/feature SHA、CONFIG_NAME/RUNNING_ENV、套件鎖定與實際安裝版本、後端契約階段,確認 submodule 及站台可啟動。
|
|
12
|
-
- PWA:現有 `npm run test:unit`(Node `tests/unit/*.test.cjs`)、`npm run test:modal-smoke`;沒有 `npm test` 或 `npm run lint`。瀏覽器 dev 使用 `npm run dev`/`npm run qa`,實際測試站路徑另核對。
|
|
13
|
-
- SSR:現有 `npm run lint`、`npm run test:modal-smoke`;沒有 unit suite,不安裝 Vitest 或提交被忽略的 tests/unit/test-support。本機一次性 Node harness 可驗純 policy,執行時記錄完整指令與輸出;瀏覽器使用既有 `npm run dev:php` 等有效站台腳本。
|
|
14
|
-
- cash:現有 `npm run test:unit`、`npm run test:modal-smoke`;dev 可用 `npm run dev:php` 或 `npm run dev:zaza`,站台需確認 SITE_MODE=cash,不能把共享 configs 的全部站台算入 cash。一般 e2e/ 已移出版本控制,不用不存在的通用 E2E suite。
|
|
15
|
-
- modal smoke 是既有回歸,不能證明 WS recovery;SSR 要讀 selfTestPassed/errorFindings 判斷 CLEAN/NEEDS-REVIEW/INVALID,不能只看 exit code。PWA/cash 依既有 deterministic 結果判讀。
|
|
16
|
-
- 升級 cuora 後需核對 package/lock/node_modules;目前 cash 本機 release 指定 1.1.476、安裝仍是 1.1.473,本次未更新或安裝。WS 保留 SDK 管理,核心 policy 放 cuora-module/src/util/socketPolicy.js;cash 不用另宣告 socket.io-client 或新增本地 manager。
|
|
17
|
-
- cuora-module 本機 origin/master 快照為 e0f0753e…、package1.1.472,scripts 沒有 test 命令;開始後 fetch 最新 master 重新核對,採一次性 Node/真實 XState harness 驗模組,正式修正版供 cash 整合。現有 OTP 未提交工作不混入;發布 SDK 仍待另行指示。
|
|
18
|
-
- 需後端配合的驗證時限、AUTH_UNAVAILABLE、滾動更新、真實重送、階段 2 列「未執行/環境阻塞」;在 mock 通過與真實環境通過分開記錄。
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## TC-01 正常登入與握手參數
|
|
23
|
-
|
|
24
|
-
**需求**:R01、R03。**適用**:三端(cash 驗修正後的 cuora machine)。**方式**:mock 整合+瀏覽器。**前置**:有效測試帳號、乾淨 Network WS 清單、可連線 test host。
|
|
25
|
-
|
|
26
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
27
|
-
| --- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------ |
|
|
28
|
-
| 1 | 未登入訪客載入,連續觸發既有大廳入口 | 沒有 token 時不建 WS,也不花重試預算 | 未執行 |
|
|
29
|
-
| 2 | 登入後檢查 CONNECT 與 transport | 只有 websocket,auth.Authorization 原始 token;URL 只有一段 /frontend、path /socket.io;無 Bearer 或 polling | 未執行 |
|
|
30
|
-
| 3 | connect 後延後 session-ready,觀察 budget;再送舊版字串或新版物件 | connect 不歸零;ready 才歸零;兩種參數皆不拋錯 | 未執行 |
|
|
31
|
-
| 4 | 模擬 select line 全失敗進 fallback | namespace 仍正確;無 /frontend/frontend;按最終確認方案驗 fallback | 未執行 |
|
|
32
|
-
|
|
33
|
-
## TC-02 錯誤政策與三代契約
|
|
34
|
-
|
|
35
|
-
**需求**:R03、R04、R06。**適用**:PWA/SSR policy、cuora policy 及 XState machine,cash 驗下游整合。**方式**:策略表格案例+整合 mock。**前置**:可控制 event/active/ready/err.data/rejection。
|
|
36
|
-
|
|
37
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
38
|
-
| --- | ----------------------------------------------------------------------------- | ------------------------------------------------------- | ------ |
|
|
39
|
-
| 1 | io client disconnect | none,無 timer | 未執行 |
|
|
40
|
-
| 2 | transport close / ping timeout / transport error;connect_error active=true | socketio,僅內建重連,狀態 CONNECTING | 未執行 |
|
|
41
|
-
| 3 | 舊版無 code,未 ready 的 server disconnect;active=false 的未知 connect_error | retry,有限新建 | 未執行 |
|
|
42
|
-
| 4 | 舊版 ready 後 server disconnect,即使沒有 kicked | kicked,不自動重新連線 | 未執行 |
|
|
43
|
-
| 5 | AUTH_MISSING / AUTH_INVALID / retryable=false 未知 code | stop;未知明確不可重試也不迴圈;AUTH_INVALID 有可用遙測 | 未執行 |
|
|
44
|
-
| 6 | AUTH_NOT_FOUND / AUTH_UNAVAILABLE,階段 1 auth-rejected→disconnect | retry,使用 retryAfterMs;rejection 只對當前 loss 生效 | 未執行 |
|
|
45
|
-
| 7 | 階段 2 只有 connect_error.err.data,沒有 connect/disconnect | 同一 policy 生效,不因缺少 disconnect 永久停住 | 未執行 |
|
|
46
|
-
| 8 | MAX_CONNECTIONS;舊 kicked reason | kicked 優先於一般 retryable=false,保持 user-only | 未執行 |
|
|
47
|
-
| 9 | SESSION_TOKEN_INVALID;舊版 session rejected | renew,拆舊新建一次,不重用拒絕 instance | 未執行 |
|
|
48
|
-
|
|
49
|
-
## TC-03 有限退避與伺服器下限
|
|
50
|
-
|
|
51
|
-
**需求**:R03–05。**適用**:三端。**方式**:fake clock/mock random +整合。**前置**:每次 connect 後驗證拒絕,固定 random=0/0.5/接近 1。
|
|
52
|
-
|
|
53
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
54
|
-
| --- | ------------------------------------------------------------- | --------------------------------------------------------------------------- | ------ |
|
|
55
|
-
| 1 | 初次拒絕後持續 connect→ 拒絕,不發 ready | 初次+最多 3 次自動重試;基底 1/2/4 秒、jitter0.5–1.5;connect 不把預算歸零 | 未執行 |
|
|
56
|
-
| 2 | retryAfterMs=10000,random=0 | delay>=10000,不出現範例舊公式的 5000ms | 未執行 |
|
|
57
|
-
| 3 | 檢查指數基底 cap 30000,後端下限 60000 | 不用 cap 截短 60000;輸入處理不形成負值/NaN timer | 未執行 |
|
|
58
|
-
| 4 | 同一 loss 重複 error/disconnect;等待中同時觸發 /self 或 user | 只有一個排程;既有 timer 不被提前;不重複扣 budget | 未執行 |
|
|
59
|
-
| 5 | 第 3 次失敗後送一次 ready 或 recovered=true | blocked 清除、budget 歸零;之後新失敗可有新的一輪 | 未執行 |
|
|
60
|
-
|
|
61
|
-
## TC-04 預算用完後恢復條件
|
|
62
|
-
|
|
63
|
-
**需求**:R05、R06。**適用**:三端。**方式**:fake clock +瀏覽器。**前置**:exhausted/stop/kicked,可控制最新 token 與 source。
|
|
64
|
-
|
|
65
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
66
|
-
| --- | ----------------------------------------------------------------------------- | --------------------------------------------------------------- | ------ |
|
|
67
|
-
| 1 | exhausted,最後嘗試後 14999ms /self 成功,再於 15000ms 成功 | 前者不建,後者只建一次;不因每輪 2/3/5 秒輪詢再開 3 次預算 | 未執行 |
|
|
68
|
-
| 2 | exhausted 後 user 點大廳/儲值等既有入口,建連仍被拒 | 可再試一次但不重置 budget、不再排三次;cash 既有 5 秒冷卻仍有效 | 未執行 |
|
|
69
|
-
| 3 | stop 且同 token,/self 成功或 user 操作 | 都不重連;token 換 B 才解除 | 未執行 |
|
|
70
|
-
| 4 | kicked 且同 token,/self 成功與 user 操作各一次 | auto 被擋,user 可試;不形成互踢 | 未執行 |
|
|
71
|
-
| 5 | exhausted/stop/kicked 換 tokenB;token 變空 | B 可解除並重計;空 token 不建 | 未執行 |
|
|
72
|
-
| 6 | PWA /self undefined/false/rank;SSR resetUserState 清空資料;cash 認證中/隱藏 | 不把失敗、排隊、清空或未裁決當作成功重連觸發 | 未執行 |
|
|
73
|
-
|
|
74
|
-
## TC-05 每分頁單一連線與非同步競態
|
|
75
|
-
|
|
76
|
-
**需求**:R02、R10。**適用**:三端。**方式**:mock 延遲選線/io、fake clock +瀏覽器。**前置**:可控制 Promise 返回及舊 instance 事件。
|
|
77
|
-
|
|
78
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
79
|
-
| --- | ---------------------------------------------------------- | -------------------------------------------------------- | ------ |
|
|
80
|
-
| 1 | 選線 await 未回時連續進大廳、儲值、回前景與 /self | 同一同步鎖擋平行建立;最多 1 個 io | 未執行 |
|
|
81
|
-
| 2 | 未 connected 但 active 自動重連,觸發既有 connect 入口 | 保留同 instance,不新增、不關掉恢复機會 | 未執行 |
|
|
82
|
-
| 3 | 尚在選線/CONNECTING 時登出,再讓 Promise 成功或失敗 | generation 已作廢;不建 WS、不覆蓋新世代狀態 | 未執行 |
|
|
83
|
-
| 4 | A 世代斷開、B 世代登入後,交付 A 的 error/ready/timer/push | A 回呼不改 B 連線、queue、budget 或 UI | 未執行 |
|
|
84
|
-
| 5 | 確需換 instance 時舊 socket connected=false | 仍 remove listener + disconnect;舊 socket 不再背景恢復 | 未執行 |
|
|
85
|
-
| 6 | cash 首次建立就發 active connect_error,後續恢復或 give-up | liveSocket 全程受管理;不存在 reject 後自行復活的孤兒 | 未執行 |
|
|
86
|
-
|
|
87
|
-
## TC-06 Token 更新與恢復被拒
|
|
88
|
-
|
|
89
|
-
**需求**:R01、R04、R10。**適用**:三端。**方式**:mock +瀏覽器/test 後端。**前置**:A/B 同帳號 token 及能重現恢復拒絕的測試環境。
|
|
90
|
-
|
|
91
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
92
|
-
| --- | --------------------------------------------------------------------------- | --------------------------------------------------------------- | ------ |
|
|
93
|
-
| 1 | 以 A 就緒後更新 B,再短斷網恢復 | auth callback 重新讀 B;不發舊 A、不額外 REST 驗證 | 未執行 |
|
|
94
|
-
| 2 | 恢復被拒的 instance 暫存舊推送,交付 session rejected/SESSION_TOKEN_INVALID | 舊 instance 銷毀,新 instance 一次;不交付拒絕 session 暫存推送 | 未執行 |
|
|
95
|
-
| 3 | renew 新 instance 仍遭驗證拒絕 | 改走有限 retry,不無限 renew;重新檢查當前 token | 未執行 |
|
|
96
|
-
| 4 | 換帳號 B 後重送與 A 同 messageId/orderId | 不沿用 A 快取/佇列抑制 B;無 A 的 toast 或帳號資料 | 未執行 |
|
|
97
|
-
|
|
98
|
-
## TC-07 短斷網與滾動更新
|
|
99
|
-
|
|
100
|
-
**需求**:R02、R03、R07、R09。**適用**:三端。**方式**:瀏覽器+後端整合。**前置**:已 ready、有恢復 offset;後端 test 可滾動重啟,停機期可推三則訊息。
|
|
101
|
-
|
|
102
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
103
|
-
| --- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------ |
|
|
104
|
-
| 1 | 收到 server-shutting-down {reconnectIn:5000} 或新 scope/graceMs | 不呼叫 disconnect 或以 5000 排新 io;等待 transport close | 未執行 |
|
|
105
|
-
| 2 | Offline30 秒後恢復;或後端滾動更新 | 同 instance 內建重連、最多 1 條活 WS;成功時 recovered=true;ready 及預算正確,無額外 resync | 未執行 |
|
|
106
|
-
| 3 | 斷線期間發 M1/M2/M3、恢復補送早於 connect | 不依賴 ready 才消費;三則副作用可達成,SSR 逐則排隊 | 未執行 |
|
|
107
|
-
| 4 | 除受影響伺服器外的另一連線保持就緒 | 不因 instance scope 停機通知使全部端主動拆線 | 未執行 |
|
|
108
|
-
|
|
109
|
-
以上真實恢復需伺服器與 adapter 支援;mock 通過不代表 test 部署已通過。
|
|
110
|
-
|
|
111
|
-
## TC-08 長斷網、換線與 REST 補抓
|
|
112
|
-
|
|
113
|
-
**需求**:R02、R05、R07、R08。**適用**:三端。**方式**:fake clock +瀏覽器/後端整合。**前置**:已曾 ready、兩條選線 host、可觀察補抓 API。
|
|
114
|
-
|
|
115
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
116
|
-
| --- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------ |
|
|
117
|
-
| 1 | 斷網 119999ms 再到 120000ms | 到期一次拆舊與清 timer;不在每個 error 延長 give-up 期限 | 未執行 |
|
|
118
|
-
| 2 | 可連網且 /self 成功或 user 操作 | 新建前重新選線;dead host 不贏測速;recovered=false→session-ready | 未執行 |
|
|
119
|
-
| 3 | 首次 ready、recovered=true、曾 ready 後新 session-ready 分別觀察 API | 僅第三類有本次新增補抓;PWA feeds/self,SSR/cash syncDepositEvt | 未執行 |
|
|
120
|
-
| 4 | 重複 session-ready 與同時 30 秒 polling,補抓慢/失敗 | 補抓合併不重疊;失敗保留狀態、不登出、不觸發 socket 重試;未處理 Promise 拒絕為零 | 未執行 |
|
|
121
|
-
| 5 | 補抓未回時登出/換帳號;REST 稍後回舊資料 | 不寫回新帳號或清掉其他單;舊結果被世代擋 | 未執行 |
|
|
122
|
-
|
|
123
|
-
## TC-09 推送去重、容量與舊契約
|
|
124
|
-
|
|
125
|
-
**需求**:R08。**適用**:三端。**方式**:純 policy +整合 handler。**前置**:四種事件,meta/無 meta、applyId/transactionId/缺 ID。
|
|
126
|
-
|
|
127
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
128
|
-
| --- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------ |
|
|
129
|
-
| 1 | 四種事件各將同 M1 推兩次 | 每則只一次 GA/toast/jackpot/更新請求;去重發生在所有副作用之前 | 未執行 |
|
|
130
|
-
| 2 | 無 meta payment 同 event +同 applyId,或 transactionId,重送兩次 | 只處理一次;不同 event/單號仍各處理 | 未執行 |
|
|
131
|
-
| 3 | 無 meta 且非 payment/payment 缺單號 | 不靠内容誤去重;照舊處理,不拋錯 | 未執行 |
|
|
132
|
-
| 4 | TTL10 分鐘邊界與 501 個唯一 ID | 快取<=500;期限符合選定<=邊界;過期可再接;不無限累積 | 未執行 |
|
|
133
|
-
| 5 | 同帳號同分頁重連重送 M1;另獨立視窗也收到 M1 | 原分頁去重;另一視窗仍可收,不做全帳號共享快取 | 未執行 |
|
|
134
|
-
| 6 | socket 成功推送後立刻 REST resync/既有 polling 回同訂單 | purchase/first_deposit/ID 契約無回歸;明列是否需跨入口冪等修正,不能把 eventID 視為 GA 自動去重 | 未執行 |
|
|
135
|
-
|
|
136
|
-
## TC-10 延遲、亂序與訂單狀態
|
|
137
|
-
|
|
138
|
-
**需求**:R08。**適用**:三端。**方式**:handler mock +業務瀏覽器。**前置**:active order A、other order B、較新已結算與較舊 pending 訊息。
|
|
139
|
-
|
|
140
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
141
|
-
| --- | ------------------------------------------------------ | ------------------------------------------------------------------ | ------ |
|
|
142
|
-
| 1 | A 已結算後送較舊 pending/延遲訊息 | 不把 A 倒退 pending,不重新顯示已清的進行中狀態 | 未執行 |
|
|
143
|
-
| 2 | active A 時送 B 結算/缺 ID/未知格式 | 不清 A;交既有 REST 輪詢或本次補抓確認 | 未執行 |
|
|
144
|
-
| 3 | messageId 格式不規則、publishedAt 不存在或不同事件亂序 | ID 只作等值比對,不解碼;不以全域 timestamp 丟掉無關事件 | 未執行 |
|
|
145
|
-
| 4 | 真實 test payload 確認 transactionId 與 applyId 層級 | GA transaction_id 非空且訂單比對一致;不憑 Notion 的不同端假設猜測 | 未執行 |
|
|
146
|
-
|
|
147
|
-
## TC-11 同帳號六視窗與 kicked
|
|
148
|
-
|
|
149
|
-
**需求**:R06。**適用**:三端。**方式**:手動瀏覽器+ test 後端。**前置**:同帳號六個獨立可見視窗,不用會被 SSR 背景釋放的普通六分頁。
|
|
150
|
-
|
|
151
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
152
|
-
| --- | --------------------------------------- | ---------------------------------------------------------------------- | ------ |
|
|
153
|
-
| 1 | 第六視窗就緒,觀察被選中的既有連線 | 收 kicked 或 ready 後 server disconnect,被踢視窗停止 auto,不輪流互踢 | 未執行 |
|
|
154
|
-
| 2 | 被踢視窗持續 /self 成功至少 30 秒 | 不新建 WS;不把定期身分檢查視為 user | 未執行 |
|
|
155
|
-
| 3 | SSR/cash 切回前景;PWA 開儲值等既有入口 | 依 user 觸發可重連一次,最多替換另一條;不重置驗證預算 | 未執行 |
|
|
156
|
-
|
|
157
|
-
test 叢集暫時異常可能不執行 5 條上限;需後端確認當時狀態,不能把偶發第六條未踢當前端失敗或通過。
|
|
158
|
-
|
|
159
|
-
## TC-12 SSR 連續推送佇列
|
|
160
|
-
|
|
161
|
-
**需求**:R09、R10。**適用**:SSR。**方式**:一次性 browser/mock 整合。**前置**:可在同 tick 送三種事件及超容量 burst,layout 已 mounted。
|
|
162
|
-
|
|
163
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
164
|
-
| --- | ------------------------------------ | -------------------------------------------------------------------------- | ------ |
|
|
165
|
-
| 1 | 同 tick 入隊三則非重複 toast/jackpot | drain 後逐則處理,不只最後一則;queue 歸空、不因清 queue 遞迴處理 | 未執行 |
|
|
166
|
-
| 2 | 三則中有兩則 messageId 相同 | 去重後僅唯一事件入隊;analytics 仍按唯一事件處理 | 未執行 |
|
|
167
|
-
| 3 | burst501 則,尚未 drain | 依草案 queue<=500、保留最新、overflow 合併一次 resync/遙測;溢出限制有記錄 | 未執行 |
|
|
168
|
-
| 4 | 有隊列時登出/app 卸載,隨後登入 B | A 佇列清空、hook/watch 停止、不顯示 A 通知 | 未執行 |
|
|
169
|
-
|
|
170
|
-
## TC-13 背景、登出、卸載與 SSR 隔離
|
|
171
|
-
|
|
172
|
-
**需求**:R02、R05、R10。**適用**:三端;SSR 隔離僅 SSR。**方式**:瀏覽器/mobile + fake clock + SSR 整合。**前置**:重試 timer、give-up、debouncedfeeds 皆可觀察,SSR 支援兩個獨立請求。
|
|
173
|
-
|
|
174
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
175
|
-
| --- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------ |
|
|
176
|
-
| 1 | 重試等待/恢復中登出,推進 fake clock 超 2 分鐘並實際觀察 30 秒 | 無新 WS、timer 歸零、listener 卸除、queue 清空;不是只等 token guard 偶然擋住 | 未執行 |
|
|
177
|
-
| 2 | PWA pending debounce 後 disconnect;cash service.stop;SSR app:unmount | 延遲 feeds/舊 Promise 不復活;所有新增 hook 及 timer 清理 | 未執行 |
|
|
178
|
-
| 3 | SSR iOS/WebKit 背景立即釋放;Blink/Gecko10 秒內切回或超時 | 保留既有差異,10 秒內取消釋放;CONNECTING 未建 socket 也能被作廢 | 未執行 |
|
|
179
|
-
| 4 | SSR 回前景期間 auth.isRevivingSession/isAutoLoggingIn 未裁決,後裁決登入/登出 | 先不連;登入裁決後最多 1 條,登出不連;bfcache pageshow 行為保持 | 未執行 |
|
|
180
|
-
| 5 | SSR 兩個帳號請求並行、app:rendered cleanup | server 不建立 socket/client timer;cache/queue/token 不跨 request,context 清理完整 | 未執行 |
|
|
181
|
-
| 6 | cash pagehide→pageshow/visibility,或 auth 尚在 checking | 保持 hasAuth/visible/認證 guard,source 正確且 5 秒冷卻仍有效 | 未執行 |
|
|
182
|
-
|
|
183
|
-
## TC-14 多站台、手機與業務回歸
|
|
184
|
-
|
|
185
|
-
**需求**:R01–10 整體回歸。**適用**:三端。**方式**:現有 test:unit/lint/Modal Smoke +手動。**前置**:桌機 Chrome、iOS Safari、Android Chrome;每端代表站台與 LTR/RTL 語系可用。
|
|
186
|
-
|
|
187
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
188
|
-
| --- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------ |
|
|
189
|
-
| 1 | 執行該端現有測試及 SSR lint,記完整指令/版本 | 現有 suite 無回歸;SSR 不用不存在的 npm test;不能以 document 驗證代替功能 pass | 未執行 |
|
|
190
|
-
| 2 | 登入、儲值成功/拒絕/過期、提款、站內信、活動、jackpot、離開遊戲 | 原 toast/頁面/金流輪詢保持;query/lang/route 與金額格式不改 | 未執行 |
|
|
191
|
-
| 3 | PWA JTC/SBI99、SSR 代表測試站、cash 確認 SITE_MODE=cash 的代表站 | auth 及 host 來源符合站台;不把需求歷史站數當現行盤點 | 未執行 |
|
|
192
|
-
| 4 | mobile/desktop,英文/泰文及現有 RTL 站,背景恢復後再操作 | offline indicator 與通知無版型/翻譯回歸;不新增硬編碼提示 | 未執行 |
|
|
193
|
-
| 5 | 執行三端現有 Modal Smoke 並判讀報告 | PWA/cash deterministic 結果;SSR 讀 selfTestPassed/errorFindings,記 CLEAN/NEEDS-REVIEW/INVALID | 未執行 |
|
|
194
|
-
| 6 | 若改 analytics callsite,檢查 manifest 與 purchase 第二參數 eventID | 事件規範保留,不直接繞過 analytics dispatcher;相關 manifest 與 source 一致 | 未執行 |
|
|
195
|
-
|
|
196
|
-
## TC-15 release/master 準備、SDK 契約與 cash 整合
|
|
197
|
-
|
|
198
|
-
**需求**:工作流前置、R01–08/R10 cuora 核心與 cash 整合。**適用**:三端及必要 cuora-module。**方式**:Git 唯讀證據+模組 harness/cash test:unit/瀏覽器。**前置**:開始授權與 Issue Id 已取得,三端 release 與模組 master 同名分支準備完成。
|
|
199
|
-
|
|
200
|
-
| # | 步驟 | 預期結果 | 結果 |
|
|
201
|
-
| --- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
|
202
|
-
| 1 | 對照功能 branch、fetch 後基底 SHA、HEAD、祖先與工作目錄 | 三前端各自最新 release、cuora 最新 master 為基底,四 repo 同名;不導入 dev 或無關 OTP 未提交內容 | 未執行 |
|
|
203
|
-
| 2 | 核對每個 submodule 前後 SHA/gitlink/remote/branch 及原 checkout | 來源有據、更新與原有偏離可區分;PWA 既有 assets/map 及 cuora OTP 工作原樣保留 | 未執行 |
|
|
204
|
-
| 3 | cash package/lock/node_modules 與 SDK 交付版本核對;模組純 policy/核心 harness 及下游整合 | 三者對齊可取得的修正版;隔離本地測試與正式版本分開記錄;不把本地路徑留進正式 lock | 未執行 |
|
|
205
|
-
| 4 | 初始化原 globalService 並首次取$socketService、start/stop/重啟;觀察 SDK 建立的 socket | 保留 cuora machine.websocket 與 Proxy 延遲初始化;沒有第二個 cash 本地管理者;stop 清理 socket/listener/timer,最多一條連線 | 未執行 |
|
|
206
|
-
| 5 | 真實 XState interpret 操作 CHECK_SOCKET、DISCONNECT_SOCKET、SET_ANALYTICS、CLEAR_SOCKET_DATA;讀 state.context/onTransition | 既有 SDKfactory/事件/context 相容;省略 source 預設 user,auto 受 blocked 限制,SESSION_READY/resync 正確;遊戲頁面現有呼叫不用全面改 | 未執行 |
|
|
207
|
-
| 6 | 檢查新增文件、工作樹 diff 及正式 bundle | 功能範圍一致;沒有 debug token 後門、敏感 log、意外提交或發布 | 未執行 |
|
|
208
|
-
| 7 | 執行既有 cuoraNotificationSubscription 與登入/OTP/OneSignal/API/storage 回歸,核對 SDK 其他下游 | 新 SDK 不引入 appSecret 或破壞其他服務;保留$request/token 來源,不另寫 auth/DT 流程 | 未執行 |
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 實際執行結果與阻塞紀錄
|
|
213
|
-
|
|
214
|
-
| 日期 | Repo/案例 | 指令或操作證據 | 結果 | 原因/後續 |
|
|
215
|
-
| ---------- | ------------------------------------ | ------------------------------------------------------------ | ------ | ------------------------------------------------------------------------------------ |
|
|
216
|
-
| 2026-10-13 | TC-01–15/三端及模組 | 尚未開始實作,沒有測試執行證據 | 未執行 | 票號已確定;使用者指定 cash 維持 cuora,已更新規劃 |
|
|
217
|
-
| 2026-10-13 | cuora 核心及 cash 整合/TC-02–11、15 | 唯讀核對 globalService 原接線與本機 origin/master 模組原始碼 | 未執行 | 核心修改與版本交付列入計畫;未 fetch/建分支/改程式,套件未交付不得宣稱正式 cash 完成 |
|
|
218
|
-
|
|
219
|
-
執行後按案例補日期、固定 commit、環境、遮罩 frames/callback 計數、timer/instance 數與結果。mock、靜態檢查、真實瀏覽器與手動驗證分開寫;實際未操作一律保留「未執行」。
|
|
220
|
-
|
|
221
|
-
## 2026-10-13 root 獨立最終驗證
|
|
222
|
-
|
|
223
|
-
| 驗證 | 命令/證據 | 結果 |
|
|
224
|
-
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
225
|
-
| PWA 完整 unit | `node --test tests/unit/*.test.cjs`;`/private/tmp/jt-socket-pwa-final-unit.log` | exit0,620/620 通過(新增 22);Node20 原 npm script quoted glob 不展開,故使用等價展開命令 |
|
|
226
|
-
| SSR 生命週期、實際 Vue/Pinia queue/layout/self | `node --test /private/tmp/jt-socket-ssr-regression.test.cjs`;`/private/tmp/jt-socket-ssr-final-regression.log` | exit0,45/45 通過;一次性 harness,未提交被禁止的 unit 層 |
|
|
227
|
-
| 兩端策略獨立契約表 | `node /private/tmp/jt-socket-policy-contract.mjs` | exit0,218 assertions 通過 |
|
|
228
|
-
| PWA 修改檔格式 | prettier --check:plugin、Cuora、policy、2 unit files | exit0 |
|
|
229
|
-
| SSR 5 個修改來源 lint | eslint:useWebSocket、useUserInfo、store、layout、policy | exit0,無警告 |
|
|
230
|
-
| SSR Vue/Pug | compiler-sfc parse、compileScript、compileTemplate(preprocessLang:pug) | exit0 |
|
|
231
|
-
| SSR 事件契約 | `node scripts/generate-event-manifest.cjs --violations` | exit0,0 violations |
|
|
232
|
-
| PWA 語法 | Babel parse 3 個 production JS sources | exit0 |
|
|
233
|
-
| SSR 全 repo lint | `npm run lint`,`/private/tmp/jt-socket-ssr-lint.log` | exit1;baseline 未改 locale-monitor.ts 3 errors、generator 8 warnings,不擴大本單修正 |
|
|
234
|
-
|
|
235
|
-
自動化覆蓋錯誤分流、三次 retry、ready 才 reset、renew 一次、exhausted 額外嘗試、120s give-up、延遲下限、15s cooldown、stale socket/選線/self、同 tick 佇列、overflow、token rotation UID proof、account change/logout、嚴格單號比對,以及 REST/socket purchase/first_deposit 與 pixel accounting。
|
|
236
|
-
|
|
237
|
-
未執行:真實後端 recovery/滾動重啟/stage2 frame、多視窗 kicked、手機 WebKit 背景、多站台/LTR/RTL、正式 build、Modal Smoke。部署狀態沒有查證;不宣稱全平台或 cash 已完成。
|
|
238
|
-
|
|
239
|
-
最終總審 finding:SSR 跨世代失效 REST promise 共用已修,新增慢 REST/重複最新意圖/登出回歸;root 獨立 45/45 通過,final scoped re-review PASS。
|
|
240
|
-
|
|
241
|
-
PWA 原目錄移入後驗證:`node --test tests/unit/*.test.cjs` 620/620 通過(exit0),`git diff --check`通過;5 來源/測試檔 byte-identical 及 map SHA 確認一致。log:`/private/tmp/jt-socket-pwa-main-unit.log`。
|
|
242
|
-
|
|
243
|
-
## cash/cuora 接續交付
|
|
244
|
-
|
|
245
|
-
原暫緩由使用者接續授權取代。程式、候選包整合與審查完成;正式 SDK 升版待發布修正版。root 實際驗證與限制見 [cash-module-verification.md](cash-module-verification.md)。
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# cuora 程式承接紀錄
|
|
2
|
-
|
|
3
|
-
## 2026-10-14 依使用者指定新增承接分支
|
|
4
|
-
|
|
5
|
-
cuora SDK WebSocket 程式、policy 與 47 項測試已由 `feat/sharon/JT-1791180540-onesignal` 承接;工作目錄仍為 `/Users/sharon/Documents/git-project/.worktrees/cuora-module/feat-sharon-JT-1790247240-socket`。基底仍是已審查的 `6b6cd8faf770a12257cf22235331efc85fb21e6a`,3 個程式/測試檔 SHA256 在切換前後一致。
|
|
6
|
-
|
|
7
|
-
原 `/Users/sharon/Documents/git-project/cuora-module` 保留 `feat/sharon/JT-1789548840-otp`,auth_otp_v3.js 與 test/完整指紋及 git 狀態確認未變。新 branch 命名依使用者本次指定,其他前端 branch 不變。
|
|
8
|
-
|
|
9
|
-
新 branch 重新驗證:`node --test tests/websocket.test.mjs` 47/47 通過,exit0;`git diff --check`通過。沒有 commit/push;工作樹變更保留。
|
package/e2e/feature-map.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Feature map — cuora-module
|
|
2
|
-
|
|
3
|
-
Hints, not facts: verify any line you rely on with this task's own check.
|
|
4
|
-
Each line ends with (observed YYYY-MM-DD <TASK-id>) = the last task that confirmed it.
|
|
5
|
-
|
|
6
|
-
## Repo-wide
|
|
7
|
-
|
|
8
|
-
- SDK with no UI and no `e2e/review-playbook.md`: no browser captures; evidence is `node --test test/*.test.js` (no `test` script in `package.json`) plus code review (observed 2026-11-17 TI-16026)
|
|
9
|
-
- Commit hook runs `npm run format` (`prettier --write .`) even with `HUSKY=0`, so ignored `prepare-for-pr/` files (review reports included) get reformatted → re-check a protected report before relying on it (observed 2026-11-17 TI-16026)
|
|
10
|
-
- Claude's `Bash(git commit:*)` allow pattern does not match an env-prefixed `HUSKY=0 git commit` → allow the prefixed form explicitly (observed 2026-11-17 TI-16026)
|
|
11
|
-
- `NPM_TOKEN_WRITE` set but `npm whoami` returned E401 → run `npm whoami` before starting a release flow (observed 2026-11-17 TI-16026)
|
|
12
|
-
|
|
13
|
-
## withdraw_manual_cash machine
|
|
14
|
-
|
|
15
|
-
- Entry: `src/machine/withdraw/withdraw_manual_cash.js`; unit test pattern in `test/auth_otp_v3.test.js` (`node:test`, `interpret`, stubbed `request.send` keyed by `descriptor.url`) (observed 2026-11-17 TI-16026)
|
|
16
|
-
- Preconditions: context `doubleWalletWithdrawLimitCheck: '0'` and a `paymentDetail` entry `{ category: 'manual', transferType: 'withdraw', minimum, maximum, method }`; stub URLs come from `src/api/payment.js` (observed 2026-11-17 TI-16026)
|
|
17
|
-
- Selectors: `loading.onError` — `src/machine/withdraw/withdraw_manual_cash.js:40`; `submitted.on.REFRESH` — `:100`; root `REFRESH` with `hasNoBank` — `:159` (observed 2026-11-17 TI-16026)
|
|
18
|
-
- States: `submitted` with a pending order is reached via `loading` → `checking` → `isProcessing` guard; REFRESH there is unconditional because the state-level handler wins over the root one (observed 2026-11-17 TI-16026)
|
|
19
|
-
- Gotchas: a failed REFRESH inside `submitted` must return to `submitted` (guard `isProcessing`), not `loaded`, or the user leaves Pending; `setInitData` resets `selectedUserBank` to `userBanks[0]` and leaves OTP fields stale (observed 2026-11-17 TI-16026)
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# JT-1776243420: Third-Party Register Carry Phone / Email Payload
|
|
2
|
-
|
|
3
|
-
## Key Changes
|
|
4
|
-
|
|
5
|
-
1. Extended third-party redirect payload assembly to read `tp_phone`, `tp_countryCode`, and `tp_email` from storage.
|
|
6
|
-
2. Preserved existing affiliate code / nickname behavior and appended new fields only when values are valid.
|
|
7
|
-
3. Cleans the temporary third-party storage keys after composing the redirect query.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Key Findings
|
|
12
|
-
|
|
13
|
-
### Strengths
|
|
14
|
-
|
|
15
|
-
1. The change is tightly scoped to the third-party auth redirect builder in `src/machine/auth.js:477-520`.
|
|
16
|
-
2. Existing affiliate code and nickname logic remains unchanged while phone / email are additive only.
|
|
17
|
-
3. Temporary keys are removed after payload composition, reducing leakage into later unrelated auth flows.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
### Behavior Observed
|
|
22
|
-
|
|
23
|
-
1. Static review confirms `phone`, `countryCode`, and `email` are appended only when storage values are not `undefined` / `null`.
|
|
24
|
-
2. Channel and subchannel fallback logic stays intact after the new fields are added.
|
|
25
|
-
3. No unrelated file changes were present in this repo for the review scope.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## 🔧 Change Type
|
|
30
|
-
|
|
31
|
-
- [ ] 🐛 Bug fix
|
|
32
|
-
- [x] ✨ New feature
|
|
33
|
-
- [ ] 💄 Style
|
|
34
|
-
- [ ] ♻️ Refactor
|
|
35
|
-
- [ ] ⚡ Performance
|
|
36
|
-
- [ ] 🔧 Chore
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 📱 Impact Scope
|
|
41
|
-
|
|
42
|
-
- Third-party register / login redirect query assembly in cuora shared auth machine.
|
|
43
|
-
- Downstream PWA clients that store `tp_phone`, `tp_countryCode`, and `tp_email` before `LOGIN_3PARTY`.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Test Completion Status
|
|
48
|
-
|
|
49
|
-
| Item | Validation Tested | Status |
|
|
50
|
-
| -------------------------- | --------------------------------------------------------------------- | ------- |
|
|
51
|
-
| Diff hygiene | `git diff --check` in `cuora-module` | PASS |
|
|
52
|
-
| Shared auth payload review | Reviewed `src/machine/auth.js:477-520` against ticket intent | PASS |
|
|
53
|
-
| Runtime redirect execution | Not run in this repo directly; validated through client repos instead | NOT RUN |
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## 📋 Spec Validation (Aligned with review-playbook)
|
|
58
|
-
|
|
59
|
-
| Spec Item | Evidence (File/Line/Result) | Status |
|
|
60
|
-
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------ |
|
|
61
|
-
| Third-party flow can carry phone when client stored it | `src/machine/auth.js:479-520` reads `tp_phone` / `tp_countryCode` and appends them to `referralObj` | PASS |
|
|
62
|
-
| Third-party flow can carry email when client stored it | `src/machine/auth.js:481-520` reads `tp_email` and appends it to `referralObj` | PASS |
|
|
63
|
-
| Affiliate code and nickname keep original logic | `src/machine/auth.js:477-500` keeps `ac` / `nick_name` handling unchanged | PASS |
|
|
64
|
-
| Temporary third-party data does not leak into later unrelated flows | `src/machine/auth.js:518-520` removes the temporary storage keys after composing the redirect URL | PASS |
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## 📋 Standards Checklist (Summary)
|
|
69
|
-
|
|
70
|
-
| Category | Result | Notes |
|
|
71
|
-
| ---------------------- | ------- | --------------------------------------------------------------------------- |
|
|
72
|
-
| Memory Safety | PASS | Simple storage reads and object assembly only. |
|
|
73
|
-
| Rendering Performance | PASS | No rendering code touched. |
|
|
74
|
-
| Network Requests | PASS | Existing redirect flow only; no extra requests added. |
|
|
75
|
-
| Bundle Optimization | PASS | No new imports or heavy logic added. |
|
|
76
|
-
| Code Quality | PASS | Scope is narrow and branch contains only the required file change. |
|
|
77
|
-
| Vue / Nuxt Standards | NOT RUN | Shared module; not a Vue / Nuxt surface. |
|
|
78
|
-
| SSR Security Standards | PASS | Query parameters are assembled from existing client-side storage path only. |
|
|
79
|
-
| Project Conventions | PASS | Matches existing storage-guard pattern used for affiliate / nickname. |
|
|
80
|
-
|
|
81
|
-
## Conclusion
|
|
82
|
-
|
|
83
|
-
This repo’s shared auth-machine change matches the ticket intent and is internally consistent. Runtime behavior was not executed in `cuora-module` directly, but both client repos now pass the new storage keys into this shared payload path.
|
|
84
|
-
|
|
85
|
-
**Overall Result:** PASS (PARTIAL)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
phase: done
|
|
2
|
-
caller: codex
|
|
3
|
-
round: none
|
|
4
|
-
pendingCaptureIds: none
|
|
5
|
-
deliveryRef: null
|
|
6
|
-
guardHash: status=" M src/machine/withdraw/withdraw_manual_cash.js | ?? test/withdraw_manual_cash.test.js"; tracked diff sha256=013984d028fdf138d1240c9fc4d4ba247a310d8c0595ef2c1da759ea44720c09; untracked test/withdraw_manual_cash.test.js sha256=fecacc81d718bc118f791d125768c0ee0204d89b9d3762d0ca15c45725c29268
|
|
7
|
-
claudeSessions: analyze=94FC61FD-8DD5-41F5-B1F5-C3E6C55E71A9 before=none dev=00904264-E71A-4E07-8723-3F15A8D7B64C after=FC2E4263-D2A2-4BCF-8BE7-EDDA430DA18F
|
|
8
|
-
blockedOn: none
|
|
9
|
-
updatedAt: 2026-11-18T17:22:00+08:00
|
|
10
|
-
|
|
11
|
-
## Current
|
|
12
|
-
|
|
13
|
-
- Committed 219a415070e8c9ee23615b60a9942d6c4dc1b02c on feat/stone/JT-1791856380-ws-refresh: `src/machine/withdraw/withdraw_manual_cash.js` + `test/withdraw_manual_cash.test.js` only (2 files, +156/-4). `git status --porcelain` clean after the commit.
|
|
14
|
-
- Hook finding: with `HUSKY=0` the pre-commit hook still ran `npm run format` (`prettier --write .`), so the globally ignored files under `prepare-for-pr/` (including the protected review report `prepare-for-pr/TI-16026.md` and `prepare-for-pr/JT-1776243420.md`) were probably rewritten by prettier. Content changes, if any, are formatting only; Codex should check the review report before relying on it.
|
|
15
|
-
- Harvest completed successfully on 2026-11-18 (`NEXT: harvested`). The wrapper redaction check passed using a temporary ignored symlink to the existing client-pwa-cash test-account config; the symlink was removed immediately after the hop. The current `e2e/feature-map.md` contains the harvested repo knowledge. The user declined the shared call-claude permission-pattern proposal; recorded verbatim in `harvest.md`, and no proposal was applied.
|
|
16
|
-
- Codex did not push, merge or publish. The user later confirmed the cuora dev package was published and installed in cash. The earlier `npm whoami` E401 is historical; no registry operation was performed in this turn.
|
|
17
|
-
- Authorization in force: the user approved the commit and shared-dev release flow, then reported that cuora was published and installed. This resumed turn only verified the installed version and wrote local evidence; no publish or push occurred.
|
|
18
|
-
- User approved the one-time no-UI exception verbatim: 「採一次性例外:報告列出 22/22 測試與獨立 review,明列截圖檢查不適用」. `self-test-report.md`, `evidence-index.json`, `verify.json`, and row-closure/redaction reports now record the unit-test proof and screenshot-check exception; top-level verification result is `ok`.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
The user reported the publish-token setup complete after receiving the requested NPM_TOKEN_WRITE setup instructions. Their exact authorization was: 「A,不過修改後需要 publish cash 才有辦法驗證,而且 publish token 有改,有需要 publish 再叫我,或是先給我指令,我更新之後你就可以直接走到底」. Codex gave the token setup instructions and the user replied 「完成」.
|
|
2
|
-
|
|
3
|
-
Interpret this as authorization to complete the remaining task flow, including the feature commit, the repository's documented merge/push to the shared dev branch, and publishing the dev package, after verifying the publishing account. Do not ask for redundant permission at the publish gate. Do not expose the token. This cuora SDK is in the user's choice A mode: local delivery with unit-test/review proof and no UI captures or Notion self-test page. The visible UI evidence will be collected in client-pwa-cash.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Analysis — TI-16026 (cuora-module)
|
|
2
|
-
|
|
3
|
-
Mode: user choice A (2026-11-17, `open-questions.md` Q1). No BEFORE/AFTER captures in this repo; proof is unit tests (`checklist.md`) plus Codex review. Size: 4 items, 0 captures.
|
|
4
|
-
|
|
5
|
-
## Change
|
|
6
|
-
|
|
7
|
-
`src/machine/withdraw/withdraw_manual_cash.js`
|
|
8
|
-
|
|
9
|
-
- `submitted: {}` (line 99) gets its own handler: `on: { REFRESH: { target: 'loading', internal: false } }`.
|
|
10
|
-
- State-level `on` takes precedence over the root `on.REFRESH` (line 156, `cond: 'hasNoBank'`), so in `submitted` the refresh is unconditional; everywhere else the root rule is unchanged.
|
|
11
|
-
- `loading` re-runs `fetchInitData` (rule gate + `getBindingPaymentInfo` + `getPendingOrder({ transferType: 'WITHDRAW' })`) → `setInitData` → `checking`: `isProcessing` → `submitted` (with the new `processing`), else `loaded` (the withdraw form). This is exactly spec flow step 3.
|
|
12
|
-
- Nothing else in the machine changes. `websocket.js` needs no change (`open-questions.md`).
|
|
13
|
-
|
|
14
|
-
Alternatives rejected:
|
|
15
|
-
|
|
16
|
-
- Removing `cond: 'hasNoBank'` from the root REFRESH: would let REFRESH reset `loaded` / `calculated` / `otp` too — changes behavior the spec does not ask for, and downstream may already send REFRESH elsewhere expecting a no-op.
|
|
17
|
-
- A new event name (e.g. `PAYMENT_UPDATED`): the spec names `REFRESH`; cash's L4 sends `REFRESH`.
|
|
18
|
-
- Doing the applyId match inside the machine: spec L4 puts the match in client-pwa-cash; the machine has no socket input.
|
|
19
|
-
|
|
20
|
-
## Unit test
|
|
21
|
-
|
|
22
|
-
New `test/withdraw_manual_cash.test.js`, same pattern as `test/auth_otp_v3.test.js` (`node:test`, `interpret`, stubbed `request.send` keyed by `descriptor.url`, `waitForState`). Run: `node --test test/withdraw_manual_cash.test.js` (no `test` script in `package.json`; do not add one — scope). Read the URLs the stub must answer from `src/api/payment.js` (`getBindingPaymentInfo`, `getDoubleWalletWithdrawRule`, `getPendingOrder`); use context `doubleWalletWithdrawLimitCheck: '0'` and a `paymentDetail` entry `{ category: 'manual', transferType: 'withdraw', minimum, maximum, method }`.
|
|
23
|
-
|
|
24
|
-
## Constraints and risks
|
|
25
|
-
|
|
26
|
-
- Public-interface impact: additive only (a new accepted event in one state). No export, signature or context-field change. Downstream: client-pwa-cash must send `REFRESH` (its own bundle); client-pwa-ssr does not use this machine.
|
|
27
|
-
- `loading.onError → loaded` (line 39-41) is silent: if the refresh request fails, the user sees the form even if the order is still pending. Pre-existing behavior for the first load; not changed here (scope). Mention in the change description.
|
|
28
|
-
- `setInitData` reads `paymentInfo.bankList` inside `assign` (line 170-171): if `send()` resolves `undefined` (maintenance), the assign throws (CLAUDE.md §2.9 item 13). Pre-existing, same on first load; not changed.
|
|
29
|
-
- Context kept across the refresh: `selectedAmount`, `selectedUserBank` is reset by `setInitData` to `userBanks[0]`, OTP fields stay stale. Harmless for the form (`isSubmittable` only runs after `SET_AMOUNT`), but note it for cash review.
|
|
30
|
-
- Formatting: `.prettierrc`; the pre-commit hook runs `npm run format && git add .` — note `git add .` would also stage `prepare-for-pr/` if it is not ignored; check `.gitignore` before the commit step.
|
|
31
|
-
|
|
32
|
-
## Delivery
|
|
33
|
-
|
|
34
|
-
Cash cannot verify until a cuora version with this change is published (user, Q1). Publish plan and the command for the user: `publish.md`.
|
|
35
|
-
|
|
36
|
-
## Feature map lines used
|
|
37
|
-
|
|
38
|
-
None (no `e2e/feature-map.md` in this repo).
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
A,不過修改後需要 publish cash 才有辦法驗證,而且 publish token 有改,有需要 publish 再叫我,或是先給我指令,我更新之後你就可以直接走到底
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
A:允許 Claude CLI 提交
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"formatVersion": 2,
|
|
3
|
-
"taskId": "TI-16026",
|
|
4
|
-
"title": "[優化][前台] 存出款 Pending 畫面依 WebSocket 即時刷新狀態",
|
|
5
|
-
"spec": { "source": "notion", "ref": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907", "externalId": "TI-16026" },
|
|
6
|
-
"delivery": { "target": "local", "ref": null },
|
|
7
|
-
"repo": "cuora-module",
|
|
8
|
-
"adapter": "none",
|
|
9
|
-
"branch": "feat/stone/JT-1791856380-ws-refresh",
|
|
10
|
-
"baseCommit": "c9186b6b3f424d74a9fe1363e64b17eb63809b58",
|
|
11
|
-
"submodules": {},
|
|
12
|
-
"runtime": [],
|
|
13
|
-
"viewports": [],
|
|
14
|
-
"locales": [],
|
|
15
|
-
"dataSource": "none: SDK without UI; proved by node:test unit tests with a stubbed request (user choice A, 2026-11-17). Screen evidence lives in the client-pwa-cash and client-pwa-ssr TI-16026 bundles. The user approved a one-time exception for screenshot-only checks on 2026-11-18.",
|
|
16
|
-
"createdBy": "claude /ui-baseline-codex",
|
|
17
|
-
"createdAt": "2026-11-17T00:00:00+08:00"
|
|
18
|
-
}
|