[W-4] Money consumed without session granted — no refund path
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
Research direction
Start by confirming whether the bug still reproduces on current upstream main, since the issue says this was not verified during migration. Then read merchant.go around lines 486-494 (the 30s timeout branch, where the Receive goroutine keeps running) and 538-552 (the grant-failure path), and check the Lightning MintTokens-then-grant flow. Done means tokens are consumed only after a session is granted, with a refund path for the other cases, and a test covers each of the three failure paths.
Written by the indexing model from the issue text.
Description
Migrated from Amperstrand/tollgate-module-basic-go#73 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: #758.]
MEDIUM-HIGH: Partial-failure accounting bug where money settles before service is decided. Three concrete paths:
- 30s timeout leaves the non-cancellable Receive goroutine running; late swap success = token consumed, no session, retry hits "already spent", no refund path.
- Gate-open failure after successful swap (including the shared
00:00:00:00:00:00fallback-MAC bucket wherendsctl authfails for a non-existent client) = same client-side loss. - Lightning:
MintTokensok + grant fail = funds parked, monitor retries forever.
File references: merchant.go:486-494 (timeout branch), :538-552 (grant-failure).
Fix: Implement grant-or-refund accounting to ensure tokens are only consumed when a session is successfully granted.
Evidence: /home/ubuntu/src/tollgate_audit_report_2026-08-26.md §7, line 146
Migrated 2026-10-09. Applicability to current upstream main (4614ac2, post-rc1) was not re-verified during migration — confirming whether the finding still reproduces upstream is this issue's first task.
- Dominant language
- Go
- Stars
- 12
- Forks
- 14
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 246
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenTollGate/tollgate-module-basic-go
-
Session event emits the customer's MAC address in the p tag — spec-invalid value on every payment responsePossibly taken @Amperstrand claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenTollGate/tollgate-module-basic-go#949 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenTollGate/tollgate-module-basic-go#833 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OpenTollGate/tollgate-module-basic-go#813 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenTollGate/tollgate-module-basic-go#804 ·
Maintainers usually reply within 1 day
-
go-battery needs an ndsctl on PATH: TestPurchaseSessionGuardHoldsThroughTheOutcomeUnknownWindow fails on bare hosts (passes with stub)Possibly taken @Amperstrand claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenTollGate/tollgate-module-basic-go#726 · 2 comments ·
Maintainers usually reply within 1 day
All issues in OpenTollGate/tollgate-module-basic-go
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
BurntSushi/toml#530 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:session-state issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openclaw/wacli#503 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Bug] rmqctl error diagnostics emit terminal control charactersPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
apache/rocketmq-dashboard#6895 ·
Maintainers usually reply within 3 days