Skip to content

fix(api): expire a stale intent and book its failure in one transaction (#36) - #1082

Merged
DevTobis merged 2 commits into
DevTobis:mainfrom
manchesternews98-jpg:fix/intents-atomic-settle-claim-36
Oct 25, 2026
Merged

DevTobis merged 2 commits into
DevTobis:mainfrom
manchesternews98-jpg:fix/intents-atomic-settle-claim-36

Conversation

@manchesternews98-jpg

@manchesternews98-jpg manchesternews98-jpg commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #36

Slimmed to the one part main still lacked. sweepPendingIntents claimed the intent as expired and then called applyFailure outside a transaction, so a crash between the two left the intent expired with its line or pledge still pending, and no later sweep revisited it. The claim and the book update now share a transaction, as settle does since #1074. A rolled-back expiry counts as an error and is retried on the next sweep.

The rest of the original branch (aging out errored intents, the settle path) is covered by #1074 and #1107, so it was dropped.

🤖 Generated with Claude Code

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@manchesternews98-jpg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

The sweep claimed the intent as expired and then applied the failure outside a
transaction, so a crash in between left it expired with its line or pledge still
pending and no later sweep revisited it (same class as DevTobis#36). Do both in one
transaction, as settle does, and count a rolled-back expiry as an error so the
next sweep retries it.

Drops the rest of this branch: the settle path is already atomic on main (DevTobis#1074)
and expiry on NOT_FOUND only is covered by DevTobis#1107.
@DevTobis DevTobis changed the title fix(api): atomically settle intent claim and book updates (#36) fix(api): expire a stale intent and book its failure in one transaction (#36) Oct 23, 2026
@DevTobis
DevTobis merged commit b3ce994 into DevTobis:main Oct 25, 2026
4 checks passed
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.

Settling an intent commits the claim before the books change, so a crash loses the update

2 participants