xmtp / example-chat-react

This repo has been archived. Replacement apps include the XMTP Quickstart React and XMTP Inbox chat apps. For more details and links, see the README in this repo.
MIT License
74 stars 52 forks source link

Bug: Wrong inbox displayed after switching accounts #153

Closed saulmc closed 1 year ago

saulmc commented 1 year ago

UPDATE: this has been repro'd in multiple browsers, not just MetaMask's in-app browser

Describe the bug

After switching between wallet accounts in MetaMask, I still have access to the previous account's messages. In Metamask browser, I was also not asked to sign for the second account. In Arc, I was asked to sign, but still saw the wrong account's messages.

Hypothesis: the first account's cached key isn't getting cleared and is overriding the key for the second account.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to xmtp.chat ~in Metamask browser~ with Account 1
  2. Connect and sign.
  3. See Account 1's messages.
  4. Switch to Account 2 in Metamask.
  5. Reload xmtp.chat
  6. See Account 1's messages still
  7. See Account 2 in the user panel

Expected behavior

On reloading the site, I should have had to sign to get keys for Account 2, and I should not have seen any of Account 1's messages.

Screenshots

Viewing saulmc.eth's messages from another account.

image image

Additional context

Reproduced in Metamask (mobile) and Arc (desktop browser).

Desktop

Smartphone