Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/features/send/cashu-send-quote-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ function useOnMeltQuoteStateChange({

const handleMeltQuoteUpdate = useCallback(
async (meltQuote: MeltQuoteResponse) => {
// TODO: remove (or mask) the sensitive data from this log (or see if we can configure sentry not to send sensitive data to server) or completely remove it.
console.debug('Melt quote updated', meltQuote);

const relatedSendQuote = sendQuotes.find(
Expand Down Expand Up @@ -625,8 +626,6 @@ export function useProcessCashuSendQuoteTasks() {
});
}
});

await cashuSendService.markSendQuoteAsPending(sendQuote);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

image

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

Copy link
Collaborator Author

@jbojcic1 jbojcic1 Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

},
retry: 3,
throwOnError: true,
Expand Down