event icon indicating copy to clipboard operation
event copied to clipboard

App freezes when paying "hold" invoices

Open boston-wine opened this issue 1 year ago • 9 comments

Describe the bug

Trying to pay a lightning "hold" invoice – for example, one that might be used as an escrow bond – the app freezes after clicking send, and requires restarting in order to function normally.

Reproduce

When using Zeus to pay a hold invoice (the type that might be utilized for lightning-escrowed funds or bonds), the app froze on "sending payment". A minute or two later, the bond invoice (on the receiving end) updated to show that it had received the funds, but Zeus was still stuck on "sending". After a few minutes with no change, I restarted the app. At this point, the payment history showed the hold invoice correctly as pending, and a while later, correctly showed the payment as expired.

I replicated this a second time, with essentially the same steps, both with relatively small (under 50K sat) invoices.

ZEUS version

v0.8.0

Node interface

Embedded LND

Network

Clearnet

Device

iPhone 11

Device operating system

16.7.1

Log output

how private is this?

boston-wine avatar Nov 22 '23 00:11 boston-wine

Hang screen looks like it's caused by this error.

ReactNativeBlobUtil failed to encode response data to BASE64 string

pcwd avatar Dec 29 '23 20:12 pcwd

A minute or two later, the bond invoice (on the receiving end) updated to show that it had received the funds,

you mean it released the preimage or just received the HTLC?

but Zeus was still stuck on "sending". After a few minutes with no change, I restarted the app. At this point, the payment history showed the hold invoice correctly as pending, and a while later, correctly showed the payment as expired.

So, did the receiving end cancel the HOLD invoice or accept it?

AndySchroder avatar Feb 25 '24 14:02 AndySchroder

If I do the following

  1. Display HOLD invoice
  2. Scan and pay hold invoice
  3. Zeus says "Sending Transaction" with yellow squiggle animation.
  4. Release preimage after 50 seconds
  5. Get Transaction successfully sent

or

  1. Display HOLD invoice
  2. Scan and pay hold invoice
  3. Zeus says "Sending Transaction" with yellow squiggle animation.
  4. Release preimage after 60 seconds
  5. Get ReactNativeBlobUtil failed to encode response data to BASE64 string error. The "Activity" history screen does show the transaction worked though.

In both cases, the app does not actually freeze.

In both cases, I would still expect a better UX.

Is there any way to know it is a HOLD invoice and allow the user to interact with it more cleanly? A hold invoice could be open for way longer than the 60 seconds of my test here.

I am using v0.8.1

AndySchroder avatar Feb 25 '24 14:02 AndySchroder

I'm thinking that if an invoice doesn't settle after a certain amount of time, it should minimize to a "in flight transactions" tab where we can go back and monitor the status of all in flight transactions. Any transactions that settle should then show a notification and if the transaction is finally cancelled, show that too. The user must swipe left or right to clear each settled or canceled transaction from the list and in flight transactions can't be removed.

The "Activity" history screen is a bad place to monitor these pending transactions from a UX point of view and because https://github.com/ZeusLN/zeus/issues/1328 causes it to take several minutes to load if you have many transactions.

AndySchroder avatar Feb 25 '24 16:02 AndySchroder

I did just once get a screen to come up that says "Payment is in transit. It may complete momentarily or it may go on to fail. Please check back later." I am not sure what triggers this scenario.

AndySchroder avatar Feb 25 '24 16:02 AndySchroder

@AndySchroder I presume you're using the LND REST interface?

kaloudis avatar Feb 26 '24 00:02 kaloudis

Yes, LND REST over clearnet.

AndySchroder avatar Feb 26 '24 13:02 AndySchroder

Note: I also tested with the following wallets yesterday:

  1. phoenix
  2. breez
  3. mutiny
  4. muun
  5. strike
  6. cash app

They all had a cleaner UX with the hold invoices where the hold invoice gracefully went to a pending or processing state in their transaction list.

Once the preimage was released, they transitioned to a complete or processed state in their transaction history.

If the hold invoice was cancelled, most of them seemed to use a word like "failed", but it wasn't a big nasty screen like in Zeus (https://github.com/ZeusLN/zeus/issues/2001), it was just in the transaction history.

Generally, the wallets that seemed more intuitive had some short/recent transaction history on the home screen, so you didn't have to go to a separate Activity screen to see how the held invoices were doing.

AndySchroder avatar Feb 26 '24 13:02 AndySchroder

Would like to add a bounty of 200,000 sat for fixing this issue.

AndySchroder avatar Mar 20 '24 18:03 AndySchroder