threshold-network / token-dashboard

23 stars 24 forks source link

(MEDIUM) Wrong transactions showed in `TX HISTORY` after switching between wallets #405

Open michalinacienciala opened 1 year ago

michalinacienciala commented 1 year ago

After disconnecting a wallet which has some transactions in TX HISTORY, those transactions are still visible.

My steps:

  1. Logged to https://dashboard.test.threshold.network/tBTC

  2. Connected with an account that has some deposit transactions already made. I can see those transactions in the TX HISTORY panel. Image

  3. Disconnected the wallet. I can still see the same transactions in the TX HISTORY panel (even if I switch between tabs in dApp). I shouldn't. Image

  4. Refreshed the website. Now the transactions are gone.

Image

michalinacienciala commented 1 year ago

Found a bit worse scenario. I was able to see transactions from one account, being logged on another account.

Let's consider two accounts that I have in my MetaMask:

Steps:

  1. I open a fresh tab in the browser and go to https://dashboard.test.threshold.network/tBTC
  2. I make sure that in my MM plugin I have Acc2 selected
  3. I click Connect Wallet -> MetaMask -> View Dashboard. I can see correct transactions: image
  4. Click the account address in the right corner -> Disconnect. Still can see the same transactions.
  5. Connect Wallet -> WalletConnect -> scanned QR code in the mobile MetaMask app which has only Acc1 configured -> Connect. I can see in the dApp that the Acc1 wallet got connected, but I can see transactions from Acc2 in the TX HISTORY: image

Also found a scenario in which I'm logged on an account, but can't see any of it's transactions in the history:

  1. I open a fresh tab in the browser and go to https://dashboard.test.threshold.network/tBTC
  2. I make sure that in my MM plugin I have Acc1 selected
  3. I click Connect Wallet -> MetaMask -> View Dashboard. I can see correct transactions: image
  4. I open MM plugin, click on Connected next to account name and then I choose Switch to this account under Acc2. I can still see ETH address of Acc1 (which is not correct and was raised in #407 ), transactions are displayed correctly: image.
  5. Now I repeat the same, changing to Acct1. Now I don't see any transactions, despite I'm logged with Acct1 which should have 4 txs. image
michalinacienciala commented 1 year ago

Change priority to MEDIUM (up for debate), because I've got a feeling that this may be also somehow related to the problems that @sashatanase saw on her account, where she had multiple same transactions displayed in her TX HISTORY.

pdyraga commented 1 year ago

I have observed similar behavior after opening two deposits:

https://goerli.etherscan.io/tx/0x4b952fa926f8826a5c5808e728677477026aeabcd9320b1c0883b82f2dcce9fd https://goerli.etherscan.io/tx/0x4b952fa926f8826a5c5808e728677477026aeabcd9320b1c0883b82f2dcce9fd

This is how the history is displayed when revealing the second deposit:

image

And this is what is displayed after refreshing the page (and what I'd expect to see):

image

It looks like the same reveal event is displayed twice sometimes - see the TX hash for the history.

Worth noting, I was not switching accounts and I do not have another account in MetaMask from where I mint tBTC.

michalinacienciala commented 1 year ago

Looks very similar to Sasha's issue... Unfortunately I can't help with reproduction steps, as I never hit this issue myself...

pdyraga commented 1 year ago

It is happening randomly on Chrome for me. There is no clear path for reproducing I am afraid.

r-czajkowski commented 1 year ago

Probably fixed in #360 and #409.

michalinacienciala commented 1 year ago

I've tested the switching between different accounts now that we've got fixes for those two issues. I never got the wrong operators' transactions in TX HISTORY, but sometimes I got no TX HISTORY data after switching. In such cases I could see the following error in the Browser's Console:

listenerMiddleware/error Error: Could not load staking
instrument.ts:124 listenerMiddleware/error Error: Could not load staking provider's operator info: Error: resolver or addr is not configured for ENS name (argument="name", value="", code=INVALID_ARGUMENT, version=contracts/5.6.2)
    at effects.ts:62:11
    at c (regeneratorRuntime.js:86:17)
    at Generator._invoke (regeneratorRuntime.js:66:24)
    at Generator.throw (regeneratorRuntime.js:117:21)
    at r (asyncToGenerator.js:3:20)
    at u (asyncToGenerator.js:29:9) {raisedBy: 'effect'}

image

michalinacienciala commented 1 year ago

@pdyraga or @sashatanase - I can't verify if problem with the duplicated transactions got resolved by fixes https://github.com/threshold-network/token-dashboard/pull/360 and https://github.com/threshold-network/token-dashboard/pull/409, as it was never occurring on my side. Could you Guys check on your environments?