Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated retries #1776

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Automated retries #1776

wants to merge 2 commits into from

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Dec 30, 2024

Description

close #1492 based on #1785, #1787

All failed invoices are returned only once to exactly one client via a new query failedInvoices. To avoid an invoice being returned but never retried by a client for any reason, a visibility timeout as described in #1492 (comment) is used: for each returned invoice, we set a new Invoice.lockedAt column to the current time and then unset it when we can assume that the client did not and will not attempt a retry of this invoice.

To not retry invoices that the user manually canceled (closing the QR code), a new boolean column Invoice.userCancel was added. This is only set if the invoice was canceled via closing the QR code.

TODO:

  • retry returned failed invoices on client
  • count retries so we can stop returning them after we hit a limit
  • show failed invoices that have exhausted retries in notifications
  • don't show failed invoices that haven't exhausted retries in notifications
  • don't retry invoices that have been manually cancelled?

added userCancel column, see #1785

  • don't return failed invoices to clients that don't have send wallets

client only polls when it has send wallets

  • don't return intermediate failed invoices that will be retried due to sender or receiver fallbacks

added "cancelledAt" < now() - interval '${WALLET_RETRY_BACKOFF_MS} milliseconds' filter

  • ⚠️ make sure when this is deployed, this will not start retrying old failed invoices ⚠️

Screenshots

Additional Context

tbd

Checklist

Are your changes backwards compatible? Please answer below:

tbd

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

tbd

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

tbd

Did you introduce any new environment variables? If so, call them out explicitly here:

tbd

@ekzyis ekzyis added feature new product features that weren't there before wallets labels Dec 30, 2024
@ekzyis ekzyis marked this pull request as draft December 30, 2024 03:28
@ekzyis ekzyis force-pushed the automated-retries branch 4 times, most recently from eb65eb5 to 7c875d1 Compare January 1, 2025 18:02
@ekzyis ekzyis force-pushed the automated-retries branch from 7c875d1 to c0157fc Compare January 1, 2025 18:28
@ekzyis ekzyis force-pushed the automated-retries branch 3 times, most recently from c9615dc to eb72117 Compare January 2, 2025 21:23
@ekzyis ekzyis force-pushed the automated-retries branch from eb72117 to 240f3c0 Compare January 4, 2025 18:53
@ekzyis ekzyis force-pushed the automated-retries branch from 240f3c0 to b1c4f23 Compare January 4, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new product features that weren't there before wallets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

automatic retries of failed paid actions
1 participant