Fix bug with marking cashu send quote as pending#619
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| } | ||
| }); | ||
|
|
||
| await cashuSendService.markSendQuoteAsPending(sendQuote); |
There was a problem hiding this comment.
This was the reason why the app would crash when you would try to pay already paid invoice. I don't remeber why I added this here but doesn't make sense because we also have regular onPending handler. It also doesn't make sense to mix it with initiate mutation because intiaite could pass and this fail and then you have retries of initiate too.
I played with sends and all still seems to be working fine so seems safe to remove
There was a problem hiding this comment.
I think this might have been for when paying an invoice from the same mint. It seems to work with this change, but I notice after the send completes then after a couple seconds this error shows up... maybe after a retry or something
I noticed this was a problem when working on #622 because I tried to add polling for send quotes as well, but if the melt quote is updated to PAID before we poll the PENDING quote, then we get this error that the send-quote must be pending to complete because we never saw the pending state
There was a problem hiding this comment.
I tested same mint payments after making this change. I also had in memory that those are the reason why we introduced this but then I saw they still work after this change. I noticed this exact thing and debugged it and I don't think it was caused by this but by the fact that mint sends two paid messages.
Was thinking that we will resolve that too with proper background task handling.
There was a problem hiding this comment.
if we want to be extra safe we can change our code to allow completing from unpaid state too. I think we should do that anyway because you could close the app after triggering the send before the pending message is received. then when you open it later you would get only paid message
No description provided.