Priority: P1 — ambiguous-outcome class at the TollGate layer. Independent of gonuts fixes.
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
Direzione di ricerca
Start with src/merchant/merchant.go:506-538 to trace the Receive timeout and normal session-grant path; then review the proposed payment-saga state names for Rust parity. The issue calls for a durable pending-payment store, late-completion handling, and startup and periodic reconciliation, so first map those existing entry points before choosing an implementation. Done means the late-success and restart-reconciliation acceptance tests pass and /usage reflects a granted session.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Priority: P1 — ambiguous-outcome class at the TollGate layer. Independent of gonuts fixes.
Problem
PurchaseSession wraps Receive in a 30s timeout, but the goroutine keeps running. When Receive completes after the timeout response was sent: funds land in the operator wallet, no session is granted, no record exists, and the customer was told "timed out, try again" — so they pay again. Duplicate value consumed for one session; every timeout has this tail risk.
Why it matters
Timeouts are routine (mobile-network mints). The current code converts each one into a potential silent confiscation with a lying error message. Same family as #403 but via the timeout path, and invisible in logs beyond a Receive-completed line nobody correlates.
Current behavior (source refs)
src/merchant/merchant.go:506-538— goroutine +selecttimeout; on timeout the notice returns immediately, goroutine abandoned.src/merchant/merchant.go:519-529— late result (success or error) is logged and dropped.- No pending-payment record anywhere (sessions are created only post-timeout-window).
Desired invariant
No Receive outcome is discarded: a late success is reconciled into a granted session (or refund) durably; a late failure clears the pending record; the customer-visible timeout message states that the payment may still complete and how to check (
GET /usage).
Proposed scope
- Durable pending-payment record keyed by token Ys hash, written before launching Receive (this is also the idempotency key — coordinate with the payment-saga design for Rust parity, Rust issues #5/#6).
- Late-completion handler: on late success → same grant path as normal completion (session + gate + record COMPLETE); on late failure → record FAILED.
- Startup + periodic reconciliation: records in RECEIVE state older than timeout → query mint proof state (NUT-07) → resolve.
- Timeout notice copy updated to reflect "may complete; check usage" (wire-compatible text change only).
Areas / files
src/merchant/merchant.go, new small store (JSONL or bbolt sub-bucket; flash-aware), startup reconciliation in merchant init.
Acceptance criteria
- Fault test: Receive completes at t=35s, timeout returned at t=30s → session granted at t=35s,
/usagereflects it, record COMPLETE. - Kill between receive-start and completion → restart reconciliation resolves by mint state.
Required tests
- Unit: late-completion grant path; reconciliation decision table.
- Integration (cloud-lab): slow-mint proxy lane.
Failure-injection tests
- Proxy delays swap response 35s (payment completes late).
- Proxy drops response entirely; mint did consume inputs (mint-side state says spent) → reconciliation grants session.
Compatibility
Notice text change only.
Dependencies
Conceptually pairs with the Rust payment-saga issue (Amperstrand/tollgate-module-basic-rust#5) — implement to the same state names for test parity.
Out of scope
- Refund issuance on late success + unreachable client (session grant suffices; refund policy lives in #403's resolution).
- Lingua principale
- Go
- Stelle
- 12
- Fork
- 14
- Merge medio
- 1g 5h
- PR unite (30g)
- 227
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenTollGate/tollgate-module-basic-go
-
changelog: dependency-security sweep missing from [Unreleased] [Amperstrand fork #105 review debt]Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
OpenTollGate/tollgate-module-basic-go#1055 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenTollGate/tollgate-module-basic-go#1027 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenTollGate/tollgate-module-basic-go#1026 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OpenTollGate/tollgate-module-basic-go#833 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
OpenTollGate/tollgate-module-basic-go#813 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OpenTollGate/tollgate-module-basic-go
Issue simili
-
[flaky test] TestValidatorCommitterDropsEmptyStatusBatch: submits to the mock VC before its stream is registeredForse già presa @liran-funaro l’ha presa oggi. Apertacoordinator flaky-test race-condition testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
hyperledger/fabric-x-committer#876 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/features
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
TencentBlueKing/bk-nodemgr#3804 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudnative-pg/plugin-barman-cloud#1187 ·
I maintainer di solito rispondono entro 1 giorno
-
[deliverclient] Remove the unused common/deliverclient packageForse già presa @liran-funaro l’ha presa oggi. Apertacode-hygiene
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hyperledger/fabric-x-common#236 ·
I maintainer di solito rispondono entro 1 giorno
-
consensus feature I2 S4 U2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno