Skip to content

Acknowledge payment receipts only after durable processing #79

Closed

Description

@ctfbruce

Problem

The listener processes receipts through a void callback, then advances checkpoint state even if local completion failed. Its error check after CompleteTransaction cannot observe that callback’s failure. Some invalid payment-method handling logs and continues, and amount conversion needs a bounded contract.

Proposed change

Validate and durably deduplicate each receipt, commit its local effect and checkpoint together, and retain/retry unresolved processing without pretending a failed event was consumed.

Acceptance criteria

  • Introduce a returned processing result and stable receipt/event identity; distinguish accepted, rejected and retryable failures.
  • Strictly validate method/currency/receiver/amount/expiry before effects, including uint64 values that do not fit the local amount representation.
  • Inject local SQL failures, duplicate/reordered events, lost acknowledgements and crashes at cursor/effect boundaries; restart must neither skip payment nor credit twice.
  • Define initial cursor/catch-up policy and reconciliation of receipts whose local intent is unavailable; do not reset or advance past uncertainty silently.
  • Exercise local fake chain/checkpoint fixtures in CI; no live chain funds or outside network are required.

Current evidence

confirmed receipt/checkpoint ownership defect; source inspection only, no new runtime reproduction. Backlog classification is based on source inspection; this issue does not claim a new runtime reproduction.

Dependencies

  • #76 — Create payment intents and order rows atomically
  • #78 — Commit order credits and earnings only when every write succeeds

Priority context

Required before enabling chain receipt processing; optional to the TEST-only alpha.

Activation

Optional work, deferred while the local team alpha is the priority. Development and fault injection use owned local fixtures. Production monetary operation, deployment and publication require the applicable release and operator approvals.

Validation must use owned local fixtures on supported Linux environments. Record the implementing merge request and relevant test results before closing this issue.


Imported from GitLab issue 78. Originally opened 2026-09-10. Historical GitLab links may require access to the original project.

Activity

  1. added this to the Optional payments milestone on Sep 24, 2026
  2. added
    bugSomething isn't working
    DeferredIntentionally deferred; see the issue for its activation condition.
    OptionalAn optional product expansion, not required for the local team alpha.
    Optional paymentsOptional credits and monetary settlement, outside the supported wallet-free alpha.
    P2Follow-on improvement or optional expansion after core requirements.
    Source reviewedCurrent source evidence checked; no new runtime reproduction claimed by backlog creation.
    on Sep 24, 2026
  3. ctfbruce commented on Oct 5, 2026

    @ctfbruce
    CollaboratorAuthor

    Implemented by #374, with integrated recovery coverage in #384. Receipts have stable event identities, validated outcomes and atomic local payment effects; failed processing leaves the checkpoint unresolved for safe replay. Local fixtures cover duplicate and reordered events, SQL failures, indexer lag and real SQLite restart recovery without a second payment effect. Initial catch-up and unknown-intent reconciliation limits are documented. Receipt CI and rehearsal CI passed. Monetary enablement remains an operator decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeferredIntentionally deferred; see the issue for its activation condition.In progressImplementation is active.OptionalAn optional product expansion, not required for the local team alpha.Optional paymentsOptional credits and monetary settlement, outside the supported wallet-free alpha.P2Follow-on improvement or optional expansion after core requirements.Source reviewedCurrent source evidence checked; no new runtime reproduction claimed by backlog creation.bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions