Repository navigation
fix(add-money): offer an open ARS deposit order back instead of creating a new one - #4118
Conversation
…ing a new one The amount step keeps the deposit details in screen state only. A person who leaves (to their bank app, home) and comes back creates a new order, and Manteca cancels the open one, which also sent them a "deposit failed" push. Since 2 Nov, 18 people replaced their own order this way; one made 26 orders in 13 minutes. The amount step now asks GET /manteca/deposit/open and, when an unpaid ARS order is open, shows a notice with "See transfer details" that opens that order's details. Entering a new amount still creates a new order.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code-analysis diffPainscore total: 11093.18 → 11093.23 (+0.05) 🆕 New findings (39)
…and 19 more. ✅ Resolved (37)
…and 17 more. 📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
…in the screen catalogue The callout copy is cut to the essentials (callout words count twice in the wordiness budget). The remaining growth on the regional add-money screen (+42) is the new open-transfer notice itself, so the baseline moves with it. The trusted capture catalogue now lists add-money-argentina-deposit-open.
There was a problem hiding this comment.
Chip review — no blocking findings — this is not an approval
One major finding: the open-transfer prompt can offer an expired or replaced order until its lookup refreshes.
Findings
-
MAJOR · src/components/AddMoney/hooks/useOpenMantecaDeposit.ts:15 · Expired transfer can reappear as open
The query remains mounted when the flow switches to depositDetails; disabling it does not clear its last data. If order A expires and the person taps Start a new deposit, the input step immediately renders cached A as “still open” while the refetch runs. On a slow or failed request they can reopen and share A’s expired bank details; the same stale window occurs after creating replacement order B. Clear or gate the cached open-order result when leaving/re-entering the amount step, and cover the expiry/replacement transition in a flow test. -
MINOR · src/services/manteca.ts:340 · [claude-opus] GET /manteca/deposit/open does not exist yet in peanut-api-ts
The new mantecaApi.getOpenDeposit calls GET /manteca/deposit/open?currency=ARS. It expects a body of { data: MantecaDepositResponseData | null }, with stages['1'].asset and stages['1'].thresholdAmount read by MantecaAddMoneyFlow. The pinned peanut-api-ts checkout registers only POST /manteca/deposit, PATCH /manteca/deposit/:depositId/cancel and GET /manteca/deposit/:depositId/status (src/routes/manteca/deposit.ts:218, 244, 295). No route answers /manteca/deposit/open, and none of the registered routes matches it by accident. That checkout is the policy branch, so the backend half is most likely an open PR that I cannot see. Nothing breaks if this merges first: the UI gets a 404, getOpenDeposit returns { error }, the hook returns null, and no callout appears. But the fix the commit describes (stopping duplicate orders that make Manteca cancel the open one) does nothing until the backend ships. Before merging, confirm the paired peanut-api-ts PR returns the same envelope ({ data: | null }, with data null when nothing is open) and the same stages shape as POST /manteca/deposit. Then merge or deploy the backend first.
Checked clean
- Exact head and merge-base diff; trusted PR metadata matched the supplied author, base, and head.
- New lookup, verified-user gate, amount-step callout, existing-order details and status polling, translations, fixture, design-system callout rules.
- Head CI was still running when checked; completed backdoor scan and bot-approval checks succeeded.
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 by claude-opus: 1 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.
Copy check by claude-haiku-5-5: 0 finding(s), titled "Copy now wrong". Every quoted passage was checked against the file.
Exact head: ec2ac9d1df19 · Context: repo, design · Took 2m
…eshes The open-order query stays mounted on the details step, so going back to the amount step showed the last answer (possibly an order that has since expired or been replaced) until the refetch finished. The hook now returns an order only from a settled lookup while enabled. Chip finding on useOpenMantecaDeposit.ts:15; the new test fails without the fix.
|
/chip review |
There was a problem hiding this comment.
Chip review — no blocking findings — this is not an approval
No findings at this head. The cached-order issue is fixed; the API route is a documented paired-change dependency with a safe missing-route fallback.
Checked clean
- Exact head, merge-base diff, trusted PR metadata, new hook guard and regression test.
- P1: the hook hides retained data while disabled or fetching, then exposes only the settled lookup result; a failed API lookup yields null.
- P2: the PR explicitly requires the paired API change to merge first; a missing route returns an error and the callout stays hidden.
- Head CI completed guard, refs, review, analyze, deployment, and security scan successfully; screenshot capture remained in progress when checked.
- Existing amount-step, details/polling, service error handling, localization, fixture, and design-system callout usage.
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 — it reads only the first review of a pull request; the first reviewer checks later rounds. This review is one reviewer short.
Copy check by claude-haiku-5-5: 0 finding(s), titled "Copy now wrong". Every quoted passage was checked against the file.
Exact head: bffcf634263b · Context: repo, design · Took 5m
The Screen Library capture answers every API call from demo-api or the API
OpenAPI snapshot, which does not have the new route yet, so every Argentine
add-money capture failed with "Missing synthetic responses: GET
/manteca/deposit/open" and the new copy never reached a captured state. The
demo answer is { data: null }; the open-order fixture overrides it.
|
/chip review |
Why
The ARS add-money step keeps the deposit order's details in screen state only. A person who leaves (to their bank app, or home) and comes back lands on the amount step again and creates a new order. Manteca keeps one open ramp-on per user, so the new order cancels the old one. Until peanut-api-ts#2158 that also sent a "deposit failed" push.
Prod data since 2 Nov: 18 people replaced their own open order this way. One made 26 orders in 13 minutes on 14 Nov.
What changes
GET /manteca/deposit/open?currency=ARS(peanut-api-ts#2158) for Argentina, when the person is verified for Manteca.currencyAmount={localCurrencyAmount || undefined}).en,es-419andpt-BR(es-ARinheritses-419: the short copy has no voseo forms).add-money-argentina-deposit-openfor the screen, listed inscripts/screens/capture-catalogue.json.Wordiness baseline
scripts/screen-wordiness-baseline.json: the regional add-money screen goes 414 → 456 (+42). That is the new notice itself: title, one sentence and the link, doubled because callout words count twice. The copy is already cut to the minimum that still says the open order is waiting and that a new amount replaces it.Merge order
Merge after peanut-api-ts#2158. Before that route exists the request fails, the hook returns null and the screen looks as it does today.
Screens (dev fixture, 390×844)
Open
/add-money/argentina/manteca?step=inputAmount¤cy=ARS&__fixture=add-money-argentina-deposit-openon a dev build to see the notice, then tap "See transfer details" for the details screen.Tests
npx jest --testPathPattern 'useOpenMantecaDeposit|useMantecaDepositPolling': 2 suites, 11 tests passed (new:useOpenMantecaDeposit.test.tsx).tsc --noEmit --incremental false: clean.