secretkeylabs / xverse-web-extension

Other
46 stars 25 forks source link

Tim/eng 3475 nonce not updating correctly after switching accounts #725

Closed teebszet closed 11 months ago

teebszet commented 11 months ago

🔘 PR Type

📜 Background

Issue Link: https://linear.app/xverseapp/issue/ENG-3475

there is a feature on the transaction request screen which checks a dapp tx request popup payload and does an auto account switch if there is a mismatch.

scenario 1: if I signed in with account 1 on the dapp, and switched my extension to account 2, expect the popup for a dapp tx will auto switch my account back to the one matching what I signed into the dapp with.

🔄 Changes

this fix doesn't change the behaviour, but ensures the auto switch also regenerates the unsignedTx with the correct account (and therefore displays the correct nonce in Edit Nonce)

Impact:

🖼 Screenshot / 📹 Video

after fix:

https://github.com/secretkeylabs/xverse-web-extension/assets/6109710/3bbd8788-4559-4f14-9736-55e88df8702e

also tested with pending transactions, and nonce increments as expected

✅ Review checklist

Please ensure the following are true before merging:

github-actions[bot] commented 11 months ago

Test with build here: https://github.com/secretkeylabs/xverse-web-extension/actions/runs/7274967866

teebszet commented 11 months ago

I see some request looping. not ready for merge