Skip to content

Fix/payment settlement delivery - #112

Open
1amKhush wants to merge 8 commits into
ContextVM:masterfrom
1amKhush:fix/payment-settlement-delivery
Open

1amKhush wants to merge 8 commits into
ContextVM:masterfrom
1amKhush:fix/payment-settlement-delivery

Conversation

@1amKhush

@1amKhush 1amKhush commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Recognizes verified payments despite missed notifications and preserves paid results across publication failures, disconnects, and worker restarts.

Depends on #110 and closes #111.

Changes

  • Add bounded cancellation, adapter resource cleanup, and authenticated NWC settlement lookup.
  • Restore response routes and session state after publication failures; preserve caller response IDs.
  • Fix stream reservation ownership and retry failed frames without duplicate terminal delivery.
  • Persist payment outcomes and result publication progress using the durable store.
  • Reconcile existing payment attempts by generation and republish stored results without another payment or handler execution.
  • Add PostgreSQL migration, cross-layer fault tests, and runtime qualification to CI.

Validation

  • Full concurrent suite: 825 passed, 5 skipped, 0 failures.
  • Typecheck, lint, build, and export checks passed.
  • Node 18 payment runtime smoke and browser bundle checks passed.
  • Tested PostgreSQL worker restarts, lost commit acknowledgements, encrypted result replay, publication failures, session eviction, and concurrent paying clients.

Boundaries

  • Live NWC, LNbits, and zap settlement runs remain unexecuted; provider behavior was mocked.
  • No automatic refunds or restoration of consumed execution rights.
  • Successful publication does not establish client receipt.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 06:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden payment settlement and result delivery

2 participants