@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,23 +0,0 @@
|
|
|
1
|
-
# S04 real backend payment-info capture
|
|
2
|
-
|
|
3
|
-
- Site: DEV https://demoegppwa.jteam.dev (cash frontend), socket wss://fnws.jteam.dev/socket.io/ namespace /frontend
|
|
4
|
-
- Account: demoegpmj2jwoz9fmjwvs4@DEMOEGP
|
|
5
|
-
- Method: wrapped WebSocket.prototype.onmessage in the page, forced a reconnect, recorded raw frames. Withdrawals submitted from the frontend; approve/reject done by the user in the back office.
|
|
6
|
-
|
|
7
|
-
## Approve (Apply ID 17950549538533255243, 5 EGP) — received 2026-11-19T02:24:07.117Z
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
42/frontend,["payment-info",{"uidSite":"demoegpmj2jwoz9fmjwvs4@DEMOEGP","event":"withdraw_success","isTracking":true,"windowType":"toast","subType":"payment","message":"Withdraw successful.","data":{"transactionId":"17950549538533255243","paymentMethod":"generalbank","value":5,"currency":"EGP","isFirst":true},"userInfo":{"uidSite":"demoegpmj2jwoz9fmjwvs4@DEMOEGP","channel":"official","subChannel":"default","level":0,"strategy":"email","verificationStatus":1,"topUp":0,"scope":"member"},"_meta":{"messageId":"(313424,0,0,-1)","publishedAt":1795055047027}},"1795055047058-0"]
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Reject (Apply ID 17950550939572850891, 5 EGP) — received 2026-11-19T02:26:30.057Z
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
42/frontend,["payment-info",{"uidSite":"demoegpmj2jwoz9fmjwvs4@DEMOEGP","event":"withdraw_rejected","isTracking":true,"windowType":"toast","subType":"payment","message":"Withdraw rejected.","data":{"transactionId":"17950550939572850891","paymentMethod":"generalbank","value":5,"currency":"EGP","isFirst":true},"userInfo":{"uidSite":"demoegpmj2jwoz9fmjwvs4@DEMOEGP","channel":"official","subChannel":"default","level":0,"strategy":"email","verificationStatus":1,"topUp":0,"scope":"member"},"_meta":{"messageId":"(314260,0,3,-1)","publishedAt":1795055189970}},"1795055189992-0"]
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Result against S04
|
|
20
|
-
|
|
21
|
-
- Channel `payment-info`, events `withdraw_success` / `withdraw_rejected`, `subType: "payment"`: all match.
|
|
22
|
-
- Order id: only `data.transactionId`, whose value equals the frontend Apply ID. No `applyId` field in either frame.
|
|
23
|
-
- ssr `matchesPaymentOrder(push, { applyId: shownApplyId })` (`withdrawManual.js:169`) reads `data.transactionId` and compares it with `order.transactionId ?? order.applyId`, so both captured frames match the shown order.
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Verify AFTER — TI-16026 (mode A, no captures)
|
|
2
|
-
|
|
3
|
-
Delivery is local with unit-test and review proof (user choice A); the bundle has no capture rows. Screen evidence is the client-pwa-cash TI-16026 bundle.
|
|
4
|
-
|
|
5
|
-
- U1–U4 (checklist unit-test items) and the two F-r1-01 regression tests: `node --test test/*.test.js` 22/22 pass (recorded in STATE.md).
|
|
6
|
-
- Review: `REVIEW CONVERGED` in review-log.md.
|
|
7
|
-
- Behaviour to state in the change description: a failed refresh in `submitted` stays on Pending (state `submitted`, old `processing`).
|
|
8
|
-
|
|
9
|
-
## Pre-commit checks
|
|
10
|
-
|
|
11
|
-
- run: `npm run format` / prettier — the diff changes `src/machine/withdraw/withdraw_manual_cash.js` and adds `test/withdraw_manual_cash.test.js`, so formatting can differ (the pre-commit hook runs it; never run in the dev hops).
|
|
12
|
-
- run: `node --test test/*.test.js` — the diff changes machine transitions.
|
|
13
|
-
- not needed: version bump by hand — the dev-branch pre-push hook computes `1.1.485-dev.N` (publish.md).
|
|
14
|
-
|
|
15
|
-
TABLE READY
|
|
16
|
-
|
|
17
|
-
## Local delivery — no-UI exception (Codex, 2026-11-18)
|
|
18
|
-
|
|
19
|
-
- User decision recorded verbatim in `harvest.md`: proposal 2 「不核准,維持現有設定」. No shared call-script proposal was applied.
|
|
20
|
-
- User approved the one-time SDK exception verbatim: 「採一次性例外:報告列出 22/22 測試與獨立 review,明列截圖檢查不適用」. This repo has no browser UI, so no BEFORE/AFTER captures were created.
|
|
21
|
-
- Current checkout: `dev` at `v1.1.485-dev.0`, `ebb47dbcc757cc59c9a9d7f9c5f5eeb150eedf9b`; task commit `219a415070e8c9ee23615b60a9942d6c4dc1b02c` is an ancestor. `node --test test/*.test.js`: 22 passed, 0 failed.
|
|
22
|
-
- `evidence-index.mjs` write and `--check`: both exit 0; 6 rows, no showcase files. `row-closure.mjs`: 6 rows, PASS=4, N/A=2, open=0. `verify-metrics.mjs --scope all`: 0 capture entries, V06/V07 pass vacuously; screenshot-specific V04, V05, capture-metric V06/V07, V10L and V18 are explicitly listed as not applicable under the approved exception in `self-test-report.md`.
|
|
23
|
-
- Redaction check: exit 0, result `ok`, no secret or token-pattern hits. The temporary ignored symlink to the existing cash test-account configuration was removed immediately after the check; neither Codex nor Claude opened that file.
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"round": 1,
|
|
3
|
-
"commit": "219a415070e8c9ee23615b60a9942d6c4dc1b02c",
|
|
4
|
-
"checkedAt": "2026-11-18T09:25:07Z",
|
|
5
|
-
"result": "ok",
|
|
6
|
-
"checks": [
|
|
7
|
-
{
|
|
8
|
-
"id": "V01",
|
|
9
|
-
"result": "ok",
|
|
10
|
-
"evidence": "checklist.md Spec trace B01–B07 covers the requirement context, all cuora acceptance statements, the cash-owned matching path, and the empty translation section."
|
|
11
|
-
},
|
|
12
|
-
{ "id": "V02", "result": "ok", "evidence": "6 rows have one latest status each: U1–U4 PASS, U5–U6 N/A with code- or spec-grounded reasons." },
|
|
13
|
-
{
|
|
14
|
-
"id": "V03",
|
|
15
|
-
"result": "ok",
|
|
16
|
-
"evidence": "Each checklist row answers D01–D13; applicable state and pending-order dimensions cite the unit tests or traced code path."
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "V04",
|
|
20
|
-
"result": "ok",
|
|
21
|
-
"evidence": "Not applicable under the user's one-time no-UI exception: this SDK has no screen to capture. Unit proof and consumer screen evidence are described in self-test-report.md."
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"id": "V05",
|
|
25
|
-
"result": "ok",
|
|
26
|
-
"evidence": "No visual BEFORE/AFTER pair is claimed. U4's unchanged root-handler behavior is asserted by the unit test; screenshot comparison is not applicable under the approved exception."
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"id": "V06",
|
|
30
|
-
"result": "ok",
|
|
31
|
-
"evidence": "Capture-recipe checks are not applicable under the approved no-UI exception. verify/metrics-check.json reports 0 capture entries; unit-test evidence is linked in self-test-report.md."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "V07",
|
|
35
|
-
"result": "ok",
|
|
36
|
-
"evidence": "No capture entries exist by scope, so screenshot runtime metadata is not applicable under the approved exception; no synthetic metrics were created."
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"id": "V08",
|
|
40
|
-
"result": "ok",
|
|
41
|
-
"evidence": "The full unit suite uses local request stubs; no transaction or account mutation was sent. Tracked product files stayed clean."
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"id": "V09L",
|
|
45
|
-
"result": "ok",
|
|
46
|
-
"evidence": "self-test-report.md follows the local-report section order, has one latest-update line, and lists no rejected review finding."
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"id": "V10L",
|
|
50
|
-
"result": "ok",
|
|
51
|
-
"evidence": "The report has no media links and evidence-index.json has no showcase pairs; the linked Notion pages are external screen-evidence references, not embedded media."
|
|
52
|
-
},
|
|
53
|
-
{ "id": "V11", "result": "ok", "evidence": "No media was uploaded; delivery target is local and there are no showcase files." },
|
|
54
|
-
{ "id": "V12L", "result": "ok", "evidence": "Every Markdown heading in self-test-report.md is on its own line and followed by a blank line." },
|
|
55
|
-
{
|
|
56
|
-
"id": "V13",
|
|
57
|
-
"result": "ok",
|
|
58
|
-
"evidence": "Local environment and data source in the report agree with bundle.json; Notion properties do not apply."
|
|
59
|
-
},
|
|
60
|
-
{ "id": "V14", "result": "ok", "evidence": "Overall PASS matches 4 PASS + 2 N/A; there are no non-PASS, non-N/A rows." },
|
|
61
|
-
{ "id": "V15", "result": "ok", "evidence": "verify/redaction.json: redaction checker exit 0, result ok, secretHits=[], patternHits=[]." },
|
|
62
|
-
{
|
|
63
|
-
"id": "V16",
|
|
64
|
-
"result": "ok",
|
|
65
|
-
"evidence": "The report's six rows have 規格/連動 labels and linked source locations; U4 includes the triggering source and via path."
|
|
66
|
-
},
|
|
67
|
-
{ "id": "V17", "result": "ok", "evidence": "U1–U4 declare measure proof; U5–U6 have no visual states or showcase media." },
|
|
68
|
-
{
|
|
69
|
-
"id": "V18",
|
|
70
|
-
"result": "ok",
|
|
71
|
-
"evidence": "No visual pair is embedded; frame comparison is not applicable under the user-approved SDK exception."
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"id": "V19",
|
|
75
|
-
"result": "ok",
|
|
76
|
-
"evidence": "node evidence-index.mjs --bundle prepare-for-pr/TI-16026 --check exited 0; evidence-index.json result=ok."
|
|
77
|
-
},
|
|
78
|
-
{ "id": "V20", "result": "ok", "evidence": "verify/row-closure.json: 6 rows, PASS=4, N/A=2, open=0, V20=ok." }
|
|
79
|
-
]
|
|
80
|
-
}
|
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
# TI-16026: Withdraw submitted-state REFRESH review
|
|
2
|
-
|
|
3
|
-
## Key Changes
|
|
4
|
-
|
|
5
|
-
1. `submitted` accepts REFRESH -> loading and reuses fetchInitData. The r2 fix makes loading.onError return to submitted when processing exists, preserving the pending order and allowing retry; first-load failure still falls back to loaded (`src/machine/withdraw/withdraw_manual_cash.js:40`, :98-101).
|
|
6
|
-
2. Target: feat/stone/JT-1791856380-ws-refresh; HEAD/base c9186b6b3f424d74a9fe1363e64b17eb63809b58. Product changes and test/withdraw_manual_cash.test.js remain uncommitted. The r2 incremental review verified the failure fix; its fresh independent convergence check reviews the complete base-to-working-tree change, including the original submitted REFRESH handler and all six untracked tests.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Key Findings
|
|
11
|
-
|
|
12
|
-
### Strengths
|
|
13
|
-
|
|
14
|
-
1. The fix reuses isProcessing and existing state names, keeps successful initialization unchanged and adds observable rejection/retry assertions with a bound bank.
|
|
15
|
-
2. A memory-only old-onError negative control makes exactly the new retry test fail, proving that it detects the original defect.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
### Behavior Observed
|
|
20
|
-
|
|
21
|
-
1. **F-r1-01 [medium], ACCEPT, verified in r2: yes.** Pending W-1 + bound bank -> REFRESH -> second pendingOrder rejects ERR_998 -> submitted with W-1 retained -> next REFRESH makes request 3 and reaches loaded. No new findings in r2. The historical finding and response remain in review-log.md.
|
|
22
|
-
2. Initial pendingOrder rejection with processing=null still reaches loaded. Successful submitted reload enters loading; an empty response clears processing and reaches loaded; another pending order replaces W-1/500 with W-2/800 and reaches submitted. All six targeted tests pass.
|
|
23
|
-
3. Root REFRESH remains conditional outside submitted. The loaded bank/no-bank transition probe passes both outcomes; other non-submitted definitions were inspected, not individually executed.
|
|
24
|
-
4. The fresh whole-change reviewer formed observations from spec/diff/source before reading the full prior STATE/log/notes, then independently reproduced the six passing tests, the negative-control failure and root boundary results. No additional finding or re-raise was identified. The driver owns the next check-review.sh invocation and STATE update; this report does not declare loop convergence.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 🔧 Change Type
|
|
29
|
-
|
|
30
|
-
- [x] 🐛 Bug fix
|
|
31
|
-
- [ ] ✨ New feature
|
|
32
|
-
- [ ] 💄 Style
|
|
33
|
-
- [ ] ♻️ Refactor
|
|
34
|
-
- [ ] ⚡ Performance
|
|
35
|
-
- [ ] 🔧 Chore
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 📱 Impact Scope
|
|
40
|
-
|
|
41
|
-
The shared SDK factory now accepts REFRESH from submitted regardless of bound banks, enters loading and fetches status again. Empty pending-order results reach loaded; a remaining order replaces processing and returns submitted. If initialization fails with an existing processing order, callers retain submitted and the previous order, then retry with the same REFRESH event. Import/export contracts, factory arguments, event/state names and successful initialization remain unchanged.
|
|
42
|
-
|
|
43
|
-
Internal unchanged consumers were searched with `rg -n 'withdraw_manual_cash|withdraw/index|\.\.\.withdraw|machine/index' src`: src/machine/withdraw/index.js:4 -> src/machine/index.js:18/:54 -> src/index.js:2/:7. Each is an export-forwarding layer without state/error decisions, needs no adaptation, and is listed in the r2 Impact block. The supplied scope also names client-pwa-cash; its exact consumer paths and rendering were not verified because no other repo was inspected. Other frontends using the factory receive the same corrected failure state.
|
|
44
|
-
|
|
45
|
-
The user selected unit tests and review for this SDK repo: adapter=none, delivery local, no SDK screenshots. Cash UI, WebSocket strict-ID behavior, real backend payloads and published-package integration remain with the cash verification flow. The convergence reviewer independently confirmed that src/machine/websocket.js:296-301 already forwards payment-info without a windowType toast filter; the spec's conditional relaxation therefore needs no additional patch on that static criterion. No real socket event was exercised. client-pwa-cash is an explicit downstream consumer; exact downstream paths were not inspected. client-pwa and client-pwa-ssr have no established direct callsite in this scoped input and were not inspected; any caller using this factory receives the same SDK behavior.
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Test Completion Status
|
|
50
|
-
|
|
51
|
-
| Item | Validation Tested | Status |
|
|
52
|
-
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
53
|
-
| R2-E1 — accepted failure fix and success regression | node --test test/withdraw_manual_cash.test.js; six cases listed below, 6 passed, 0 failed, exit 0. | PASS |
|
|
54
|
-
| R2-E2 — test sensitivity | Same suite with only old unconditional loading.onError restored in memory: failed retry case times out waiting for submitted; 5 passed, 1 failed, exit 1 expected. | PASS |
|
|
55
|
-
| R2-E3 — root REFRESH boundary | Pure transitions: loaded with no bank -> loading; loaded with bound bank -> loaded; assertions pass, exit 0, no request. | PASS |
|
|
56
|
-
| R2-E4 — code/whitespace | git diff --check, empty output, exit 0; inspect onError, onDone, guard, initializer and exports. | PASS |
|
|
57
|
-
| C2-E1–C2-E4 — independent whole-change convergence | Fresh spec/source review, complete base-to-working-tree diff and untracked test; independently rerun six tests (6 pass), old-onError negative control (expected 1 failure), root boundaries (pass) and whitespace check (pass). Raw output below. | PASS |
|
|
58
|
-
| Full suite / alternate wallet gates / OTP / other errors | Not selected for this scoped whole-change review: services, wallet gating and OTP definitions are unchanged; no exhaustive event or error enumeration. | NOT RUN |
|
|
59
|
-
| Cash UI / real backend / published package | Outside this SDK review and not executed; user choice A replaces SDK screenshot evidence. | NOT RUN |
|
|
60
|
-
|
|
61
|
-
Evidence is embedded in this report because only this report, review-log.md and review-notes.md are writable. All commands ran from cuora-module. Local response stubs exercise the real XState factory and initializer without transport/backend calls or transactions.
|
|
62
|
-
|
|
63
|
-
R2-E1 raw output:
|
|
64
|
-
|
|
65
|
-
```text
|
|
66
|
-
$ node --test test/withdraw_manual_cash.test.js
|
|
67
|
-
✔ REFRESH in submitted re-runs loading and fetches the pending order again (4.531542ms)
|
|
68
|
-
✔ REFRESH in submitted returns to the form when no order is pending (0.86175ms)
|
|
69
|
-
✔ REFRESH in submitted keeps submitted with the updated order when one is still pending (1.483625ms)
|
|
70
|
-
✔ a failed refresh in submitted keeps the pending order and a later REFRESH retries (0.742208ms)
|
|
71
|
-
✔ a failed first load without a pending order still shows the form (0.394833ms)
|
|
72
|
-
✔ REFRESH in loaded with a bound bank is still ignored (22.485208ms)
|
|
73
|
-
ℹ tests 6
|
|
74
|
-
ℹ suites 0
|
|
75
|
-
ℹ pass 6
|
|
76
|
-
ℹ fail 0
|
|
77
|
-
ℹ cancelled 0
|
|
78
|
-
ℹ skipped 0
|
|
79
|
-
ℹ todo 0
|
|
80
|
-
ℹ duration_ms 114.366834
|
|
81
|
-
exit: 0
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
R2-E2 exact command (memory only):
|
|
85
|
-
|
|
86
|
-
```sh
|
|
87
|
-
node --input-type=module <<'NODE'
|
|
88
|
-
import test from 'node:test'
|
|
89
|
-
import assert from 'node:assert/strict'
|
|
90
|
-
import { readFileSync } from 'node:fs'
|
|
91
|
-
import { interpret, createMachine } from 'xstate'
|
|
92
|
-
import original from './src/machine/withdraw/withdraw_manual_cash.js'
|
|
93
|
-
const suite = readFileSync('test/withdraw_manual_cash.test.js', 'utf8').replace(/^import .*\n/gm, '')
|
|
94
|
-
const mutant = (...args) => {
|
|
95
|
-
const machine = original(...args)
|
|
96
|
-
return createMachine({ ...machine.config, states: { ...machine.config.states, loading: { ...machine.config.states.loading, invoke: { ...machine.config.states.loading.invoke, onError: { target: 'loaded' } } } } }, machine.options)
|
|
97
|
-
}
|
|
98
|
-
console.log('NEGATIVE CONTROL ONLY: restore old loading.onError in memory; files unchanged')
|
|
99
|
-
new Function('test', 'assert', 'interpret', 'withdrawManualCash', suite)(test, assert, interpret, mutant)
|
|
100
|
-
NODE
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
```text
|
|
104
|
-
NEGATIVE CONTROL ONLY: restore old loading.onError in memory; files unchanged
|
|
105
|
-
✔ REFRESH in submitted re-runs loading and fetches the pending order again (4.642166ms)
|
|
106
|
-
✔ REFRESH in submitted returns to the form when no order is pending (1.186167ms)
|
|
107
|
-
✔ REFRESH in submitted keeps submitted with the updated order when one is still pending (1.146458ms)
|
|
108
|
-
✖ a failed refresh in submitted keeps the pending order and a later REFRESH retries (1001.534792ms)
|
|
109
|
-
✔ a failed first load without a pending order still shows the form (0.655125ms)
|
|
110
|
-
✔ REFRESH in loaded with a bound bank is still ignored (22.874459ms)
|
|
111
|
-
ℹ tests 6
|
|
112
|
-
ℹ suites 0
|
|
113
|
-
ℹ pass 5
|
|
114
|
-
ℹ fail 1
|
|
115
|
-
ℹ cancelled 0
|
|
116
|
-
ℹ skipped 0
|
|
117
|
-
ℹ todo 0
|
|
118
|
-
ℹ duration_ms 1034.528792
|
|
119
|
-
Error: Timed out waiting for submitted
|
|
120
|
-
at Timeout.eval [as _onTimeout] (eval at <anonymous> (.../[eval1]:12:1), <anonymous>:7:45)
|
|
121
|
-
at listOnTimeout (node:internal/timers:605:17)
|
|
122
|
-
at process.processTimers (node:internal/timers:541:7)
|
|
123
|
-
exit: 1 (expected)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
R2-E3 exact command and output:
|
|
127
|
-
|
|
128
|
-
```sh
|
|
129
|
-
node --input-type=module <<'NODE'
|
|
130
|
-
import assert from 'node:assert/strict'
|
|
131
|
-
import factory from './src/machine/withdraw/withdraw_manual_cash.js'
|
|
132
|
-
const machine = factory({ send() { throw new Error('No requests expected') } })
|
|
133
|
-
assert.equal(machine.transition('loaded', 'REFRESH').value, 'loading')
|
|
134
|
-
const withBank = machine.withContext({ ...machine.context, userBanks: [{ bankCode: 'BANK' }] })
|
|
135
|
-
assert.equal(withBank.transition('loaded', 'REFRESH').value, 'loaded')
|
|
136
|
-
console.log('PASS: root REFRESH no bank -> loading; bound bank -> loaded; no requests')
|
|
137
|
-
NODE
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```text
|
|
141
|
-
PASS: root REFRESH no bank -> loading; bound bank -> loaded; no requests
|
|
142
|
-
exit: 0
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Fresh r2 whole-change convergence evidence
|
|
146
|
-
|
|
147
|
-
C2-E1 repeats `node --test test/withdraw_manual_cash.test.js` against the actual working tree:
|
|
148
|
-
|
|
149
|
-
```text
|
|
150
|
-
✔ REFRESH in submitted re-runs loading and fetches the pending order again (4.552ms)
|
|
151
|
-
✔ REFRESH in submitted returns to the form when no order is pending (1.1955ms)
|
|
152
|
-
✔ REFRESH in submitted keeps submitted with the updated order when one is still pending (1.1305ms)
|
|
153
|
-
✔ a failed refresh in submitted keeps the pending order and a later REFRESH retries (0.741834ms)
|
|
154
|
-
✔ a failed first load without a pending order still shows the form (0.394833ms)
|
|
155
|
-
✔ REFRESH in loaded with a bound bank is still ignored (22.575125ms)
|
|
156
|
-
ℹ tests 6
|
|
157
|
-
ℹ suites 0
|
|
158
|
-
ℹ pass 6
|
|
159
|
-
ℹ fail 0
|
|
160
|
-
ℹ cancelled 0
|
|
161
|
-
ℹ skipped 0
|
|
162
|
-
ℹ todo 0
|
|
163
|
-
ℹ duration_ms 118.840542
|
|
164
|
-
exit: 0
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
C2-E2 independently repeats the R2-E2 memory-only command above (only the console label changes):
|
|
168
|
-
|
|
169
|
-
```text
|
|
170
|
-
NEGATIVE CONTROL: old loading.onError in memory; files unchanged
|
|
171
|
-
✔ REFRESH in submitted re-runs loading and fetches the pending order again (4.803667ms)
|
|
172
|
-
✔ REFRESH in submitted returns to the form when no order is pending (1.337542ms)
|
|
173
|
-
✔ REFRESH in submitted keeps submitted with the updated order when one is still pending (1.228041ms)
|
|
174
|
-
✖ a failed refresh in submitted keeps the pending order and a later REFRESH retries (1002.164458ms)
|
|
175
|
-
✔ a failed first load without a pending order still shows the form (2.062334ms)
|
|
176
|
-
✔ REFRESH in loaded with a bound bank is still ignored (24.000333ms)
|
|
177
|
-
ℹ tests 6
|
|
178
|
-
ℹ suites 0
|
|
179
|
-
ℹ pass 5
|
|
180
|
-
ℹ fail 1
|
|
181
|
-
ℹ cancelled 0
|
|
182
|
-
ℹ skipped 0
|
|
183
|
-
ℹ todo 0
|
|
184
|
-
ℹ duration_ms 1039.1935
|
|
185
|
-
Error: Timed out waiting for submitted
|
|
186
|
-
at Timeout.eval (.../[eval1]:12:1, <anonymous>:7:45)
|
|
187
|
-
at listOnTimeout (node:internal/timers:605:17)
|
|
188
|
-
at process.processTimers (node:internal/timers:541:7)
|
|
189
|
-
exit: 1 (expected)
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
C2-E3 independently repeats the exact R2-E3 root-boundary command:
|
|
193
|
-
|
|
194
|
-
```text
|
|
195
|
-
PASS: root REFRESH no bank -> loading; bound bank -> loaded; no requests
|
|
196
|
-
exit: 0
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
C2-E4: `git diff --check` produced no output. `shasum -a 256 src/machine/withdraw/withdraw_manual_cash.js test/withdraw_manual_cash.test.js` confirms the same reviewed product/test artifacts:
|
|
200
|
-
|
|
201
|
-
```text
|
|
202
|
-
13cfd851560c1b60c1bdf206d1c67d1db04d2f2db6652dde698659a34ec391f9 src/machine/withdraw/withdraw_manual_cash.js
|
|
203
|
-
fecacc81d718bc118f791d125768c0ee0204d89b9d3762d0ca15c45725c29268 test/withdraw_manual_cash.test.js
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
`ps -eo pid,rss,command` was denied (`operation not permitted`). No server or background process was started; each Node tool call returned an exit status. No product file was changed by any probe.
|
|
207
|
-
|
|
208
|
-
### Historical r1 evidence
|
|
209
|
-
|
|
210
|
-
These runs predate the r2 fix and preserve E1–E6 references in the append-only review log/notes. E5 records the original defect; current verification is R2-E1–E3 above.
|
|
211
|
-
|
|
212
|
-
E1 command and raw output (final targeted run):
|
|
213
|
-
|
|
214
|
-
```text
|
|
215
|
-
$ node --test test/withdraw_manual_cash.test.js
|
|
216
|
-
✔ REFRESH in submitted re-runs loading and fetches the pending order again (4.575458ms)
|
|
217
|
-
✔ REFRESH in submitted returns to the form when no order is pending (0.872334ms)
|
|
218
|
-
✔ REFRESH in submitted keeps submitted with the updated order when one is still pending (1.584917ms)
|
|
219
|
-
✔ REFRESH in loaded with a bound bank is still ignored (23.343833ms)
|
|
220
|
-
ℹ tests 4
|
|
221
|
-
ℹ suites 0
|
|
222
|
-
ℹ pass 4
|
|
223
|
-
ℹ fail 0
|
|
224
|
-
ℹ cancelled 0
|
|
225
|
-
ℹ skipped 0
|
|
226
|
-
ℹ todo 0
|
|
227
|
-
ℹ duration_ms 119.1075
|
|
228
|
-
exit: 0
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
E2 exact read-only probe:
|
|
232
|
-
|
|
233
|
-
```sh
|
|
234
|
-
node --input-type=module <<'NODE'
|
|
235
|
-
import assert from 'node:assert/strict'
|
|
236
|
-
import factory from './src/machine/withdraw/withdraw_manual_cash.js'
|
|
237
|
-
const machine = factory({ send() { throw new Error('Pure transition check must not send requests') } })
|
|
238
|
-
assert.equal(machine.transition('loaded', 'REFRESH').value, 'loading')
|
|
239
|
-
const withBank = machine.withContext({ ...machine.context, userBanks: [{ bankCode: 'BANK' }] })
|
|
240
|
-
assert.equal(withBank.transition('loaded', 'REFRESH').value, 'loaded')
|
|
241
|
-
console.log('PASS: loaded + no bank -> loading; loaded + bound bank -> loaded (pure transitions, no network)')
|
|
242
|
-
NODE
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
```text
|
|
246
|
-
PASS: loaded + no bank -> loading; loaded + bound bank -> loaded (pure transitions, no network)
|
|
247
|
-
exit: 0
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
E3 exact negative-control command (the changed guard exists only in a new in-memory machine):
|
|
251
|
-
|
|
252
|
-
```sh
|
|
253
|
-
node --input-type=module <<'NODE'
|
|
254
|
-
import test from 'node:test'
|
|
255
|
-
import assert from 'node:assert/strict'
|
|
256
|
-
import { readFileSync } from 'node:fs'
|
|
257
|
-
import { interpret } from 'xstate'
|
|
258
|
-
import original from './src/machine/withdraw/withdraw_manual_cash.js'
|
|
259
|
-
const suite = readFileSync('test/withdraw_manual_cash.test.js', 'utf8').replace(/^import .*\n/gm, '')
|
|
260
|
-
const mutant = (...args) => original(...args).withConfig({ guards: { hasNoBank: () => true } })
|
|
261
|
-
console.log('NEGATIVE CONTROL ONLY: force hasNoBank=true in memory; repository files are unchanged')
|
|
262
|
-
new Function('test', 'assert', 'interpret', 'withdrawManualCash', suite)(test, assert, interpret, mutant)
|
|
263
|
-
NODE
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
```text
|
|
267
|
-
NEGATIVE CONTROL ONLY: force hasNoBank=true in memory; repository files are unchanged
|
|
268
|
-
✔ REFRESH in submitted re-runs loading and fetches the pending order again (4.814583ms)
|
|
269
|
-
✔ REFRESH in submitted returns to the form when no order is pending (1.313709ms)
|
|
270
|
-
✔ REFRESH in submitted keeps submitted with the updated order when one is still pending (1.213916ms)
|
|
271
|
-
✖ REFRESH in loaded with a bound bank is still ignored (1.107ms)
|
|
272
|
-
ℹ tests 4
|
|
273
|
-
ℹ suites 0
|
|
274
|
-
ℹ pass 3
|
|
275
|
-
ℹ fail 1
|
|
276
|
-
ℹ cancelled 0
|
|
277
|
-
ℹ skipped 0
|
|
278
|
-
ℹ todo 0
|
|
279
|
-
ℹ duration_ms 11.370083
|
|
280
|
-
|
|
281
|
-
✖ failing tests:
|
|
282
|
-
|
|
283
|
-
✖ REFRESH in loaded with a bound bank is still ignored (1.107ms)
|
|
284
|
-
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
|
285
|
-
false !== true
|
|
286
|
-
at TestContext.eval (...[eval1]:9:1), <anonymous>:103:12)
|
|
287
|
-
code: ERR_ASSERTION; actual: false; expected: true; operator: strictEqual
|
|
288
|
-
exit: 1 (expected)
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
The negative control corresponds to `test/withdraw_manual_cash.test.js:105`; in the evaluated copy, import removal and Function wrapping shift the displayed line number. No files needed restoration.
|
|
292
|
-
|
|
293
|
-
E5 exact read-only convergence reproduction (local stub, no network or transaction):
|
|
294
|
-
|
|
295
|
-
```sh
|
|
296
|
-
node --input-type=module <<'NODE'
|
|
297
|
-
import assert from 'node:assert/strict'
|
|
298
|
-
import { interpret } from 'xstate'
|
|
299
|
-
import factory from './src/machine/withdraw/withdraw_manual_cash.js'
|
|
300
|
-
const pending = { applyId: 'W-1', amount: 500 }
|
|
301
|
-
let pendingCalls = 0
|
|
302
|
-
const request = {
|
|
303
|
-
async send({ url }) {
|
|
304
|
-
if (url === 'payment/v2/getBindingPaymentInfo') return { bankList: [{ bankCode: 'BANK' }], ewalletList: [], cryptoList: [] }
|
|
305
|
-
if (url === 'payment/v2/withdrawRule') return { enableWithdraw: true }
|
|
306
|
-
if (url === 'payment/v2/pendingOrder') {
|
|
307
|
-
if (++pendingCalls === 1) return [pending]
|
|
308
|
-
throw { code: 'ERR_998' }
|
|
309
|
-
}
|
|
310
|
-
throw new Error(`Unexpected descriptor: ${url}`)
|
|
311
|
-
},
|
|
312
|
-
}
|
|
313
|
-
const service = interpret(factory(request, {
|
|
314
|
-
paymentDetail: [{ category: 'manual', transferType: 'withdraw', method: 'MANUAL', minimum: 100, maximum: 10000 }],
|
|
315
|
-
})).start()
|
|
316
|
-
async function waitFor(value) {
|
|
317
|
-
for (let i = 0; i < 100; i++) {
|
|
318
|
-
if (service.state.matches(value)) return
|
|
319
|
-
await new Promise(resolve => setTimeout(resolve, 1))
|
|
320
|
-
}
|
|
321
|
-
throw new Error(`Did not reach ${value}: ${service.state.value}`)
|
|
322
|
-
}
|
|
323
|
-
try {
|
|
324
|
-
await waitFor('submitted')
|
|
325
|
-
service.send('REFRESH')
|
|
326
|
-
await waitFor('loaded')
|
|
327
|
-
assert.deepEqual(service.state.context.processing, pending)
|
|
328
|
-
assert.equal(pendingCalls, 2)
|
|
329
|
-
service.send('REFRESH')
|
|
330
|
-
assert.equal(service.state.value, 'loaded')
|
|
331
|
-
assert.equal(pendingCalls, 2)
|
|
332
|
-
console.log('REPRODUCED: pendingOrder ERR_998 after submitted REFRESH -> loaded, stale processing W-1; bound-bank REFRESH retry ignored (2 calls).')
|
|
333
|
-
} finally {
|
|
334
|
-
service.stop()
|
|
335
|
-
}
|
|
336
|
-
NODE
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
```text
|
|
340
|
-
REPRODUCED: pendingOrder ERR_998 after submitted REFRESH -> loaded, stale processing W-1; bound-bank REFRESH retry ignored (2 calls).
|
|
341
|
-
exit: 0
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
This run asserts the observed bad outcome to prove the counterexample. It does not claim that error recovery passed. The production Request path rethrows ERR_998 without errorHandler (`src/request/request.js:337–338`), matching the stub's rejection contract. No duplicate submission or rendered downstream outcome was tested.
|
|
345
|
-
|
|
346
|
-
E6 command and raw output:
|
|
347
|
-
|
|
348
|
-
```text
|
|
349
|
-
$ node --test test/withdraw_manual_cash.test.js
|
|
350
|
-
✔ REFRESH in submitted re-runs loading and fetches the pending order again (4.547083ms)
|
|
351
|
-
✔ REFRESH in submitted returns to the form when no order is pending (0.8585ms)
|
|
352
|
-
✔ REFRESH in submitted keeps submitted with the updated order when one is still pending (1.423208ms)
|
|
353
|
-
✔ REFRESH in loaded with a bound bank is still ignored (22.29425ms)
|
|
354
|
-
ℹ tests 4
|
|
355
|
-
ℹ suites 0
|
|
356
|
-
ℹ pass 4
|
|
357
|
-
ℹ fail 0
|
|
358
|
-
ℹ cancelled 0
|
|
359
|
-
ℹ skipped 0
|
|
360
|
-
ℹ todo 0
|
|
361
|
-
ℹ duration_ms 115.091791
|
|
362
|
-
exit: 0
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
---
|
|
366
|
-
|
|
367
|
-
## Conditional Review Triggers
|
|
368
|
-
|
|
369
|
-
| Trigger | Hit | Action |
|
|
370
|
-
| ---------------------------------- | --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
371
|
-
| Stateful SDK error/retry selection | YES | Trace invoke rejection, guarded transition, context preservation, successful assignment/checking, handler precedence and root guard. No identity/storage/attribution/queue changes, so those sdk-state.md sections do not apply. |
|
|
372
|
-
| Required SDK UI checks | NO | No SDK UI runtime; explicit user choice A. Rendered cash evidence is outside this repo review. |
|
|
373
|
-
|
|
374
|
-
---
|
|
375
|
-
|
|
376
|
-
## 📋 Spec Validation (Aligned with review-playbook)
|
|
377
|
-
|
|
378
|
-
The driver restricts review inputs; no checklist or author analysis was read. Rows cite raw spec clauses and the explicit acceptance criteria rather than claim unseen checklist alignment. The fresh convergence check repeats the whole-change source review and C2-E1–C2-E3 checks independently.
|
|
379
|
-
|
|
380
|
-
| Spec Item | Evidence (File/Line/Result) | Status |
|
|
381
|
-
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
382
|
-
| Confirmed — submitted REFRESH reloads pending order (spec-snapshot.md:76) | Handler :100 -> invoke :34 -> getPendingOrder :276; test :58-70 asserts loading and query 2; R2-E1. | PASS |
|
|
383
|
-
| Confirmed — empty response returns form; remaining order updates pending (spec-snapshot.md:71), SDK state portion | setInitData :172-184 -> checking :44; tests :72-100 assert undefined processing/loaded and replacement W-2/submitted; R2-E1. | PASS |
|
|
384
|
-
| Confirmed r2 — failure preserves Pending and permits bound-bank retry | onError :40 uses isProcessing :229-230 and skips assignment; test :106-121 proves retained W-1 and call 3; R2-E1/E2. F-r1-01 verified yes. | PASS |
|
|
385
|
-
| Confirmed r2 — first-load failure preserves previous behavior | processing starts null at :21; fallback :40 -> loaded; test :123-133, R2-E1. | PASS |
|
|
386
|
-
| Confirmed r2 regression — non-submitted root guard unchanged | Root :159 and hasNoBank :226-227 unchanged; test :135-149 and R2-E3. Other non-submitted states inspected only. | PASS |
|
|
387
|
-
| Conditional SDK WebSocket filter relaxation (spec-snapshot.md:77) | src/machine/websocket.js:296-301 already forwards payment-info without a toast filter; no additional filter patch required on this static criterion. Real payload behavior is unverified. | PASS |
|
|
388
|
-
| Full cash UI / WebSocket strict-ID / published-package integration | Outside SDK repo review; cash flow owns verification. | NOT RUN |
|
|
389
|
-
|
|
390
|
-
---
|
|
391
|
-
|
|
392
|
-
## 📋 Standards Checklist (Summary)
|
|
393
|
-
|
|
394
|
-
| Category | Result | Notes |
|
|
395
|
-
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
|
|
396
|
-
| XState v4 / context | PASS | Reuses isProcessing; rejection adds no assignment; successful onDone unchanged. |
|
|
397
|
-
| Correctness | PASS | All selected whole-change SDK acceptance cases pass; F-r1-01 independently verified again during convergence. |
|
|
398
|
-
| Security | NOT RUN | No wider security audit; no auth/request-boundary edits or remote requests. |
|
|
399
|
-
| Performance | PASS | Static inspection: no new timer, loop or dependency; retries remain explicit REFRESH events. No benchmark. |
|
|
400
|
-
| Project Conventions | PASS | Minimal guarded transition fits existing checking pattern; whitespace check passes. No formatter/lint run. |
|
|
401
|
-
|
|
402
|
-
## Conclusion
|
|
403
|
-
|
|
404
|
-
The fresh r2 convergence reviewer independently checked the complete base-to-working-tree change before reading prior review records and found no additional product-code defect. F-r1-01 remains ACCEPT + verified in r2 yes. Targeted tests pass 6/6, the old-onError negative control fails exactly the new retry case as expected, and both root guard boundaries pass. The r2 Impact block now covers the whole change with one line for each of the three internal consumers. This independent review is complete within the assigned SDK scope. The driver must run check-review.sh and update STATE; this report does not declare loop convergence or readiness to publish.
|
|
405
|
-
|
|
406
|
-
Limits: injected local ERR_998 responses exercise the real initializer but not transport/backend, cash rendering, real WebSocket payloads, published-package wiring, alternate wallet gates, OTP, exhaustive non-submitted events or other errors. No browser ran, so browser exceptions were not assessed. ps -eo pid,rss,command was denied (operation not permitted); no server/background process started, all Node commands exited. Only three assigned review files were written; STATE remains the driver's responsibility. Convergence pre-edit backups: /var/folders/s8/rjb4nddx2f1c_nl7p_wwz8kh0000gn/T/TI-16026-cuora-r2-convergence.iivyDMK8Pm/.
|
|
407
|
-
|
|
408
|
-
**Overall Result:** PASS
|
package/scripts/auto-version.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Copyright 2024 The Terasology Foundation
|
|
3
|
-
|
|
4
|
-
// dev/qa 分支自動計算下一個 prerelease 版號
|
|
5
|
-
// 版號格式:{master 版號}-{分支名}.{遞增編號}
|
|
6
|
-
// 範例:master=2.1.1,dev 第 5 次推送 → 2.1.1-dev.5
|
|
7
|
-
//
|
|
8
|
-
// 由 auto-version.sh(pre-push hook)呼叫
|
|
9
|
-
// 將新版號輸出至 stdout;若版號無需變更則靜默結束
|
|
10
|
-
|
|
11
|
-
import { execSync } from 'node:child_process'
|
|
12
|
-
import { readFileSync } from 'node:fs'
|
|
13
|
-
|
|
14
|
-
// 取得當前分支,僅在 dev/qa 分支執行
|
|
15
|
-
const branch = execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim()
|
|
16
|
-
|
|
17
|
-
if (branch !== 'dev' && branch !== 'qa') {
|
|
18
|
-
process.exit(0)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// 從 origin/master 取得基礎版號,若失敗則退而使用本地 master
|
|
22
|
-
let masterVersion
|
|
23
|
-
try {
|
|
24
|
-
masterVersion = JSON.parse(execSync('git show origin/master:package.json', { encoding: 'utf8' })).version
|
|
25
|
-
} catch {
|
|
26
|
-
try {
|
|
27
|
-
masterVersion = JSON.parse(execSync('git show master:package.json', { encoding: 'utf8' })).version
|
|
28
|
-
} catch {
|
|
29
|
-
console.error('Cannot read master package.json version')
|
|
30
|
-
process.exit(1)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 讀取當前 package.json 版號,組合 prerelease 前綴
|
|
35
|
-
const currentVersion = JSON.parse(readFileSync('package.json', 'utf8')).version
|
|
36
|
-
const prefix = `${masterVersion}-${branch}.`
|
|
37
|
-
let nextNum = 0
|
|
38
|
-
|
|
39
|
-
// 從當前版號推算下一個編號
|
|
40
|
-
// 例如 currentVersion="2.1.1-dev.4" → nextNum=5
|
|
41
|
-
if (currentVersion.startsWith(prefix)) {
|
|
42
|
-
const num = parseInt(currentVersion.slice(prefix.length), 10)
|
|
43
|
-
if (!isNaN(num)) nextNum = num + 1
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// 掃描 git log 找出該前綴歷史上使用過的最大編號
|
|
47
|
-
// 防止合併後版號回退(merge 可能覆寫 currentVersion)
|
|
48
|
-
// 例如:合併後 currentVersion="2.0.9-dev.20",但歷史中存在 "2.1.1-dev.4"
|
|
49
|
-
// → historyMax=4,nextNum=5(而非從 0 重新開始)
|
|
50
|
-
try {
|
|
51
|
-
const log = execSync(`git log ${branch} --pretty=%s --grep="^${masterVersion}-${branch}\\\\." -n 50`, {
|
|
52
|
-
encoding: 'utf8',
|
|
53
|
-
})
|
|
54
|
-
for (const line of log.trim().split('\n')) {
|
|
55
|
-
if (!line.startsWith(prefix)) continue
|
|
56
|
-
const n = parseInt(line.slice(prefix.length), 10)
|
|
57
|
-
if (!isNaN(n) && n >= nextNum) nextNum = n + 1
|
|
58
|
-
}
|
|
59
|
-
} catch {}
|
|
60
|
-
|
|
61
|
-
const newVersion = `${prefix}${nextNum}`
|
|
62
|
-
|
|
63
|
-
// 版號未變更,無需升版
|
|
64
|
-
if (currentVersion === newVersion) {
|
|
65
|
-
process.exit(0)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// 輸出新版號供 auto-version.sh 使用
|
|
69
|
-
console.log(newVersion)
|
package/scripts/auto-version.sh
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
# 在 dev/qa 分支自動升版並發布
|
|
4
|
-
# 由 pre-push hook 呼叫,$1 為遠端名稱(預設 origin)
|
|
5
|
-
|
|
6
|
-
# 取得遠端名稱(未傳入則預設為 origin)
|
|
7
|
-
REMOTE=${1:-origin}
|
|
8
|
-
# 取得當前分支名稱
|
|
9
|
-
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
10
|
-
|
|
11
|
-
# 僅在 dev 或 qa 分支執行自動升版流程
|
|
12
|
-
if [ "$BRANCH" = "dev" ] || [ "$BRANCH" = "qa" ]; then
|
|
13
|
-
# 透過 Node 腳本計算下一個 prerelease 版號(會掃描 git log 避免版號回退)
|
|
14
|
-
NEXT_VERSION=$(node scripts/auto-version.js)
|
|
15
|
-
|
|
16
|
-
# 若版號無變化,跳過發布流程
|
|
17
|
-
if [ -z "$NEXT_VERSION" ]; then
|
|
18
|
-
echo "Version unchanged, skipping release."
|
|
19
|
-
exit 0
|
|
20
|
-
fi
|
|
21
|
-
|
|
22
|
-
echo "Branch: $BRANCH"
|
|
23
|
-
echo "Next version: $NEXT_VERSION"
|
|
24
|
-
|
|
25
|
-
# 使用 standard-version 升版:更新 package.json 版號、產生 CHANGELOG、建立 commit + tag
|
|
26
|
-
npx standard-version --release-as "$NEXT_VERSION"
|
|
27
|
-
|
|
28
|
-
# 推送到遠端並執行 npm publish
|
|
29
|
-
node scripts/branch-auto-npm-publish.js "$REMOTE" "$BRANCH"
|
|
30
|
-
|
|
31
|
-
# 以 exit 1 中斷原本的 git push(因為上面的腳本已經完成推送了)
|
|
32
|
-
exit 1
|
|
33
|
-
fi
|