Repository navigation
Conversation
…omits declared, so the drawer sends the swap itself; tests now use the shape the compact API sends
…ile the first may land A send failure after broadcast, a record failure after a mined send, or a reload mid-send showed the generic error with Send enabled again, so a second tap paid twice (ChargeSendFlow.tla Buggy counterexamples). The spend engine now reports each broadcast and tags ambiguous failures; usePendingChargeSend keeps a pending marker, routes those failures to recovery and keeps Pay off until the charge or the chain says the send is final.
… request pay, and pin the spend engine's broadcast tag Old record-timeout cases that expected a retry after a mined send (charge read FAILED, no-response record timeout) now expect recovery: they encoded the bug.
… back Dropping the marker after a day could release Send for an op that landed while nobody looked (TLC counterexample). Past a day, recovery instead counts an op it still cannot find as dropped, and an op that executed is still found.
… the chain After a reload the wallet address loads after mount; reading user-op outcomes without the sender reported every op unknown for the whole window.
…guard fix(payments): no second transfer while a charge-backed send may still land (TASK-25240)
fix(profile): TASK-25239 residence reorder keeps the verified country when /users/me omits declared
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code-analysis diffPainscore total: 11168.74 → 11190.35 (+21.61) 🆕 New findings (106)
…and 86 more. ✅ Resolved (87)
…and 67 more. 📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
The API's feature report now answers local from the resident's own account with its step, names the step on every ready entry (activate or enroll), and lets the identity refusal answer for Bridge rails closed by an ended approval. Fixture-driven tests read the same answers the API sends.
… of merging into it Merged entry by entry, the demo report's enroll steps leaked into a fixture that set the same accounts on.
fixtures: TASK-25239 keep the feature report mirror in step with api#2208
There was a problem hiding this comment.
Chip review — INCOMPLETE · changes requested
⚠️ This review is incomplete. The third opinion (product truth, tests, contract) did not run — claude-api_error (after a retry; first: claude-api_error). The copy check did not run — claude-api_error (after a retry; first: claude-api_error). Its questions are unanswered, not answered clean. Comment/chip reviewto run it again.
Four paths can re-enable a charge-backed payment without proving that the first transfer cannot duplicate.
Findings
-
BLOCKING · src/features/payments/shared/hooks/usePendingChargeSend.ts:148 · Keep the send guard after money moved but the charge is unbooked
If a transfer mined but recording keeps failing and the charge remains PENDING, recovery reaches its 60-second deadline and returnssent; this line deletes the marker. Revisiting the same recipient or request then enables Pay and can send a second transfer while the first has already moved money. Retain the marker forsentuntil authoritative completion or another reconciliation that makes a repeat safe; keep retrying idempotent recording on resume. -
BLOCKING · src/features/payments/shared/hooks/usePendingChargeSend.ts:190 · Do not declare an old send unsent when its outcome is unreadable
After 24 hours, if the charge read fails and the bundler or nonce read fails,readUserOpOutcomereturnsunknown, but this age check alone returnsnot-sent, deletes the marker, and tells the payer no money left. An executed transfer hidden by a temporary read outage can then be paid again; the same branch also overridesbackendBroadcastanduntrackedBroadcast. Require a successful, conclusive reconciliation before offering Pay, rather than treating elapsed time or a failed read as proof. -
BLOCKING · src/features/payments/shared/utils/pending-charge-send.ts:48 · Make a failed storage write visible to the send guard
When localStorage is full,setItemthrows andwritePendingChargeSendsaves the marker inmemory, butgetItemstill succeeds withnull, so this read never consultsmemory.isPendingstays false andonBroadcastcannot update the marker; after an ambiguous send or reload, Pay can be offered again. Read the in-memory fallback even whengetItemreturns null, and fail closed or reconcile authoritatively when a durable marker cannot be saved. -
BLOCKING · src/hooks/wallet/spendBroadcast.ts:90 · Treat a submit timeout response as an unknown send outcome
A gateway can return HTTP 408 after/rain/cards/withdraw/submitwas accepted.rainRequestwraps that response inApiError, and this blanket 4xx rule calls it a definitive refusal.useSpendBundlethen leaves the failure untagged and the payment flow clears its marker, allowing another transfer while the first may land. Keep 408 ambiguous; only endpoint-specific, proven no-effect responses should release the guard.
Checked clean
- Exact detached head, base SHA, PR description, and changed runtime paths verified; no issue or review comments read.
- Reviewed direct send, pot contribution, request pay, wallet broadcasts, recovery, and their trace tests; tests do not cover the four failure scenarios above.
- Residence reorder, feature-report fixture, design rules, and four locale strings checked without another finding.
- At review time analyze, human-authors, and backdoor-scan passed; unit, i18n-overflow, press-contract, and seo-contract were still running.
- Mono engineering/patterns/state-machines.md was unavailable at its cited path; state-machine behavior was checked against code and tests.
Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.
Third opinion: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.
Copy check: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.
Exact head: fda8a6a4d0f0 · Context: repo, design, locale-glossary · Took 5m
|
|
||
| const recover = useCallback(async (): Promise<PendingSendOutcome> => { | ||
| const finish = (outcome: Exclude<PendingSendOutcome, 'cancelled'>) => { | ||
| if (key && outcome !== 'in-flight') writePendingChargeSend(key, null) |
There was a problem hiding this comment.
BLOCKING: Keep the send guard after money moved but the charge is unbooked
If a transfer mined but recording keeps failing and the charge remains PENDING, recovery reaches its 60-second deadline and returns sent; this line deletes the marker. Revisiting the same recipient or request then enables Pay and can send a second transfer while the first has already moved money. Retain the marker for sent until authoritative completion or another reconciliation that makes a repeat safe; keep retrying idempotent recording on resume.
| send = { ...send, txHash: executed.executed } | ||
| writePendingChargeSend(key, send) | ||
| } else if ( | ||
| isPastWaitWindow(send) || |
There was a problem hiding this comment.
BLOCKING: Do not declare an old send unsent when its outcome is unreadable
After 24 hours, if the charge read fails and the bundler or nonce read fails, readUserOpOutcome returns unknown, but this age check alone returns not-sent, deletes the marker, and tells the payer no money left. An executed transfer hidden by a temporary read outage can then be paid again; the same branch also overrides backendBroadcast and untrackedBroadcast. Require a successful, conclusive reconciliation before offering Pay, rather than treating elapsed time or a failed read as proof.
|
|
||
| export function readPendingChargeSendRaw(key: string): string | null { | ||
| try { | ||
| return window.localStorage.getItem(key) |
There was a problem hiding this comment.
BLOCKING: Make a failed storage write visible to the send guard
When localStorage is full, setItem throws and writePendingChargeSend saves the marker in memory, but getItem still succeeds with null, so this read never consults memory. isPending stays false and onBroadcast cannot update the marker; after an ambiguous send or reload, Pay can be offered again. Read the in-memory fallback even when getItem returns null, and fail closed or reconcile authoritatively when a durable marker cannot be saved.
| export function isDefinitiveSendRefusal(error: unknown): boolean { | ||
| if (isStaleKeyError(error)) return true | ||
| const status = apiErrorStatus(error) | ||
| if (status !== undefined) return status >= 400 && status < 500 |
There was a problem hiding this comment.
BLOCKING: Treat a submit timeout response as an unknown send outcome
A gateway can return HTTP 408 after /rain/cards/withdraw/submit was accepted. rainRequest wraps that response in ApiError, and this blanket 4xx rule calls it a definitive refusal. useSpendBundle then leaves the failure untagged and the payment flow clears its marker, allowing another transfer while the first may land. Keep 408 ambiguous; only endpoint-specific, proven no-effect responses should release the guard.
|
Review preview: 392496e → fda8a6a. Incomplete capture; unavailable states are listed in the report. Other locales were not captured; add the Before was captured with the base branch's own synthetic API because this PR changes it; differences can include synthetic-data changes. Screen Library coverage: review — UI review needs a complete, unique comparison for every required locale. Screen Library copy: review — 1 changed copy key(s) appear in no captured state: payment.errors.paymentNotSent. 3 baseline entries are now shown or deleted; remove from scripts/screens/copy-coverage-baseline.json: card.yourCard.redZone, paymentLoading.sayingHola, profile.unlockPayments.chips.attention. Add a capture state that shows the copy, or add the keys to the baseline with “Screen Library copy exception: ” on its own line in the PR description. Copy coverage: 1300/4070 keys shown. |
One PR into
devfor the state-machine hardening in Release 170 (API twin: peanut-api-ts umbrella PR). Each sub-PR was reviewed and merged intofeat/state-machine-hardeningon its own. Specs and method: monoengineering/api/state-machines/; the rule: monoengineering/patterns/state-machines.md.Sub-PRs
enrollstep); no screen changeNo-regression evidence
devand pass here: direct send 7 of 8 fail → 11/11 pass; pot 3/3 → 3/3; request pay 4/4 → 4/4; residence reorder 3 of 5 → 5/5.Release notes
payment.errors.paymentNotSentin 4 locales.devmerge.