KomodoPlatform / komodo-wallet-desktop

Komodo Wallet Desktop GUI
https://atomicdex.io
GNU General Public License v2.0
238 stars 207 forks source link

[BUG]: Swaps history break #350

Closed tonymorony closed 4 years ago

tonymorony commented 4 years ago

Describe the bug

I've used the app quite actively and performed over than 30 swaps as maker and taker, on some point my "Recent swaps" page cleared and new swaps not displaying here however DB is still there. I suspect that some swap file broke it, investigating.

App version: latest dev, OS: Windows

Log: history_adex.log

Noticed adex-api panic in log, maybe it's related:

10 07:08:23, common:438] panicked at '

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!   unwrap! called on Result::Err                                              !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
mm2src\coins\lp_coins.rs:397,9 in coins

Err(Os { code: 87, kind: Other, message: "The parameter is set incorrectly." })

', <::std::macros::panic macros>:5:6
10 07:08:23, common:439] backtrace
  ??:0] BaseThreadInitThunk 0x7ffbecf97bd3
  ??:0] RtlUserThreadStart 0x7ffbedd2ce50
tonymorony commented 4 years ago

By bisection method I've found a file caused it (without this one tx history displaying fine):

6462abf3-bcb9-46dc-bd55-693361d147e4.zip

It's a swap with "StartFailed" event (btw mm2 panic unrelated to that problem)

tonymorony commented 4 years ago

that looks like exactly the same problem as in https://github.com/KomodoPlatform/atomicDEX-Pro/issues/234 so it's not fixed it seems

artemii235 commented 4 years ago

@tonymorony Do you see the panic repeatedly or it happened just once? It was caused by this code https://github.com/KomodoPlatform/atomicDEX-API/blob/08d013c6a5983ccb590b246a5600387f9918a805/mm2src/coins/lp_coins.rs#L397, history cache file failed to be renamed and panicked due to unwrap, we should handle this gracefully on MM2 side. Could you please open an issue in AtomicDEX-API repo for further investigation?

tonymorony commented 4 years ago

@artemii235 I can see it on every GUI startup, sure will open the issue now

Milerius commented 4 years ago

I'm following this one, thanks for the issue @tonymorony

tonymorony commented 4 years ago

I'm following this one, thanks for the issue @tonymorony

great! yea, would be superb if GUI can handle "type": "StartFailed" swaps

tonymorony commented 4 years ago

fixed in https://github.com/KomodoPlatform/atomicDEX-Pro/pull/349