safe-wallet-web
safe-wallet-web copied to clipboard
Improve cleanup of pending transactions state
Bug description
A pending transaction state is cleaned up whenever one of the following transaction events are emitted:
TxEvent.SIGNATURE_INDEXED | TxEvent.SUCCESS | TxEvent.REVERTED | TxEvent.FAILED
As long as there is still a pending transaction we don't allow users to execute another transaction. There are reports that users end up in this state even though there is seemingly no pending transaction.
We should implement a more robust way of cleaning up this state instead of only relying on events that are emitted if the app is opened and the tx watcher is running.
Steps to reproduce
Need to figure out steps to reproduce this. Simply submitting a transaction and closing the app doesn't work because as soon as the app is reopened, we start the watcher based on the pending tx state and the watcher emits those events.
Expected result
If there is no pending transaction in the queue there should also be no pending transaction in the local storage
Obtained result
Transaction is executed but the pending transaction state is still there