Skip to content

feat(auto-resolve): add configurable fallback action for unmatched auto-resolve rules#253

Open
johnsaviour56-ship-it wants to merge 2 commits into
Stellar-split:mainfrom
johnsaviour56-ship-it:add-fallback-action-for-auto-resolve
Open

feat(auto-resolve): add configurable fallback action for unmatched auto-resolve rules#253
johnsaviour56-ship-it wants to merge 2 commits into
Stellar-split:mainfrom
johnsaviour56-ship-it:add-fallback-action-for-auto-resolve

Conversation

@johnsaviour56-ship-it

Copy link
Copy Markdown

Summary

This PR adds support for configurable fallback actions in auto_resolve(), ensuring invoices do not remain unresolved when no auto-resolve rule matches at the configured deadline.

Changes

  • Added an optional fallback_action field to invoice options and persisted invoice data.
  • Updated auto_resolve() to execute the configured fallback action (release or refund) when no auto-resolve rule matches.
  • Preserved existing behavior when no fallback action is configured, leaving the invoice unchanged.
  • Ensured auto_resolve() remains idempotent, preventing repeated execution after an invoice has already been resolved.
  • Added tests covering fallback refund behavior, idempotency, and the no-op path when no fallback is configured.

Testing

Added coverage for:

  • Fallback action execution when no rules match
  • Refund fallback via auto_resolve()
  • No-op behavior when no fallback is configured
  • Idempotent repeated calls to auto_resolve()
  • Regression checks for existing auto-resolve functionality

Acceptance Criteria

  • Executes configured fallback action when no rules match
  • Preserves existing no-op behavior when no fallback is configured
  • auto_resolve() remains idempotent
  • Added tests for fallback refund scenario
  • All existing tests pass
  • cargo clippy passes without warnings

Closes #224

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@johnsaviour56-ship-it 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

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.

Build creator-configurable auto-resolve fallback chain

1 participant