aurora-is-near / rainbow-bridge-client

Monorepo containing Aurora-maintained libraries for using the Rainbow Bridge
https://github.com/near/rainbow-bridge-client/tree/main/packages/client#readme
MIT License
25 stars 7 forks source link

Rare bug with transfer initialization from NEAR. #38

Closed paouvrard closed 3 years ago

paouvrard commented 3 years ago

I've observed in some cases that a transfer initialization (nep141 burn/ $NEAR lock) can fail with this error as if the urlParam was not set here before checkWithdraw is called and marks the transfer as failed. Instead since the url param should already be set, checkWithdraw should simply ignore this transfer because the redirect has not happened yet. image

paouvrard commented 3 years ago

This is issue is caused by checkStatus being called in between these 2 async calls: track and withdraw https://github.com/aurora-is-near/rainbow-bridge-client/blob/958578e606816be463c91d87b9b6990b34166ceb/packages/nep141-erc20/src/bridged-nep141/sendToEthereum/index.js#L330

paouvrard commented 3 years ago

Fixed here: https://github.com/aurora-is-near/rainbow-bridge-client/pull/30/commits/d965fc4cd7cbfc414b6ba75dc005c3ea8b5fa879