breez / breez-sdk-greenlight

MIT License
244 stars 43 forks source link

Bug: ReverseSwaps in past `Payments` are not synced across clients #1030

Closed danielgranhao closed 4 months ago

danielgranhao commented 4 months ago

When a Payment is made in the context of a reverse swap, its LnPaymentDetails contains an instance of ReverseSwapInfo. We've noticed that this reverse_swap_info field remains empty for other clients other than the one that initiated the reverse swap. This can easily be reproduced by deleting the local state of an SDK client and restarting it.

dangeross commented 4 months ago

I'm trying to reproduce this, but I'm seeing the reverse_swap_info filled correctly if I delete the local state. If possible can you open the sync_storage.sql file and check the reverse_swaps table. You should see entries for each reverse swap, where the preimage column matches the payment details payment_preimage

danielgranhao commented 4 months ago

Thanks for looking into this @dangeross. I came back now to the same node, and now the reverse_swap_info wasn't missing! I tried to do it again, deleting the local state and restarting, and it was there again, but it moved back to status InProgress for a little bit before changing to CompletedConfirmed again.

Either I overlooked something or the data was missing then and is here now. Closing this for now. I'll reopen if I see this again.