breez-sdk icon indicating copy to clipboard operation
breez-sdk copied to clipboard

Send Onchain: Ambiguous column name id

Open dangeross opened this issue 1 year ago • 3 comments

When initiating a reverse swap this error appears:

[BreezSdk] {CONFIG} (2024-05-17T20:00:25.015695Z) : Persisting new status for reverse swap 7dKBIz to be InProgress
[BreezSdk] {CONFIG} (2024-05-17T20:00:25.046263Z) : Updating lockup_txid for reverse swap 7dKBIz to be - lockup_txid: None
[ReverseSwapBloc] {SEVERE} (2024-05-17T20:00:25.052289Z) : payOnchain error
FrbAnyhowException(Generic: Sql persistence: ambiguous column name: id in 
            SELECT
                     
            reverse_swaps.id as id,
            created_at_block_height as created_at_block_height,
            preimage as preimage,
            private_key as private_key,
            timeout_block_height as timeout_block_height,
            claim_pubkey as claim_pubkey,
            invoice as invoice,
            onchain_amount_sat as onchain_amount_sat,
            sat_per_vbyte as sat_per_vbyte,
            receive_amount_sat as receive_amount_sat,
            redeem_script as redeem_script,
            status as status,
            lockup_txid as lockup_txid,
            claim_txid as claim_txid         
            
            FROM sync.reverse_swaps
             LEFT JOIN reverse_swaps_info ON reverse_swaps.id = reverse_swaps_info.id
            WHERE id = ?1
             at offset 813)

Screenshot_20240517_220054

dangeross avatar May 17 '24 20:05 dangeross

Which SDK version is the app using?

ok300 avatar May 18 '24 05:05 ok300

Which SDK version is the app using?

@ok300 It's built fromsavage-reverse-swap-notification which is 6 commits behind main. I think @roeierez is already looking into it.

dangeross avatar May 18 '24 05:05 dangeross

It seems that the ambiguity is the id field that exists both on reverse_swaps and sync.reverse_swaps. @dangeross I think changing the condition here to reverse_swap.id = ?1 should solve it: https://github.com/breez/breez-sdk/blob/savage-reverse-swap-notification/libs/sdk-core/src/persist/reverseswap.rs#L99

roeierez avatar May 20 '24 07:05 roeierez