breez-sdk
breez-sdk copied to clipboard
Send Onchain: Ambiguous column name id
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)
Which SDK version is the app using?
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.
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