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

Update payment and generate Event from OffersMessageHandler #2837

Closed
jkczyz opened this issue Jan 18, 2024 · 0 comments · Fixed by #3085
Closed

Update payment and generate Event from OffersMessageHandler #2837

jkczyz opened this issue Jan 18, 2024 · 0 comments · Fixed by #3085

Comments

@jkczyz
Copy link
Contributor

jkczyz commented Jan 18, 2024

OffersMessageHandler may handle an InvoiceError in response to either an InvoiceRequest or Bolt12Invoice sent via the onion message reply path. It may also send an InvoiceError in such scenarios. Currently, however, it doesn't update OutboundPayments (when applicable) or generate any Events, when appropriate.

Different scenarios must be considered:

  • sending vs receiving the InvoiceError
  • whether the InvoiceError is in response to an InvoiceRequest or Bolt12Invoice
  • whether the InvoiceError corresponds to an Offer or Refund

Implementing the correct behavior may involve providing additional information in the reply path such that the received InvoiceError can be correlated with a payment.

For example, when receiving an InvoiceError in response to an InvoiceRequest, OutboundPayments should be updated and generate an Event::InvoiceRequestFailed. However, this requires knowing the PaymentId when handling the InvoiceError. To implement this properly, the reply path must not only contain this data, but the handler interface must change to provide this information.

There may also be a case where we send a Bolt12Invoice without a reply path, so there won't be an InvoiceError response. Fixing this, if needed, would require further changes to the handler interface to allow for adding a reply path.

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 a pull request may close this issue.

1 participant