ens-registrar-dapp icon indicating copy to clipboard operation
ens-registrar-dapp copied to clipboard

DApp should offer bid backup/download without waiting for confirmation

Open Arachnid opened this issue 7 years ago • 5 comments

...and without going via browser storage first; this way there's no chance that the browser can clear storage between a bid and the user being able to back it up.

Arachnid avatar May 14 '17 13:05 Arachnid

This is especially needed when using the cheaper/slower gas price option, which can lead to a few minutes of waiting to see the "Download Bids" popup. During that time it is tempting to continue to work within the dapp and then perhaps quit, possibly forgetting to export the bids.

mjmau avatar May 14 '17 21:05 mjmau

Even safer: the DApp could wait for the user to confirm that they've saved the bid info before sending the transaction (like myetherwallet.com)

carver avatar May 15 '17 23:05 carver

I now realize the situation is even worse than I thought. The bid secret isn't even saved to LocalStorage until after the transaction confirms. So if the user exits the browser or reloads the page after bidding but before confirmation, not only do they miss the chance to make a backup, but the primary data isn't even saved in the browser.

This is based on my reading of: https://github.com/ethereum/ens-registrar-dapp/blob/6de8e271f3aa15c3b1024176a624a4318b49f232/app/imports/templates/components/newBid.js#L172-L186 where updatePendingBids(name) is not called until after the TxHandler reports success, which happens only after confirmation in a block: https://github.com/ethereum/ens-registrar-dapp/blob/c3c75bd8e8cdc613b4eca7c6e864072483733d85/app/imports/lib/helpers/helperFunctions.js#L126-L141

Am I interpreting that correctly?

mjmau avatar May 16 '17 07:05 mjmau

This is incorrect. PendingBids is saved on localstorage as much as MyBids is and is constantly checked to see if it should be added to the MyBids collection

alexvandesande avatar May 16 '17 07:05 alexvandesande

Good to hear! Sorry for the false alarm. I am glad I misinterpreted the code.

mjmau avatar May 16 '17 08:05 mjmau