Open dimxy opened 1 month ago
I did an experiment and apparently the .tmp file option works okay both on linux and windows: I tried to open file.txt for reading and overwrite it with async_fs::rename() from file1.tmp to file1.txt to ensure that rename does not fail. I suggest use it for now and later get rid of swap files in favour db as we do it now for wasm
Bug description Test test_taker_completes_swap_after_taker_payment_spent_while_offline may fail with error:
Commit: 9a82349f14aa0acbd083f2787c1599ed7c80cbf6 Environment: Native (non-wasm)
More Information Apparently this may happen for swaps v1 due to concurrent access to the swap file: writing swap state to the swap file (while a swap in progress) and reading from the swap file by querying my_swap_status(). Example of this is test_taker_completes_swap_after_taker_payment_spent_while_offline test which waits for swap completion periodically calling my_swap_status().
Proposed Solution We have several options to fix this: