Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

OrbitDB error when logging in with a different account #905

@e18r

Description

@e18r

Bug description

When a user logs out, refreshes the page, and then tries to log in with a different Ethereum account, an error is thrown from OrbitDB's ipfs-log repo:

Uncaught (in promise) Error: Could not append entry, key "did:3:bafyreiboe6bsrc6xxqxi5urmfyaw6weevhfkotn3n23dpnkbalz2donana" is not allowed to write to the log
at Log.append (log.js:308)
at async FeedStore.addOperation (Store.js:517)
at async run (index.js:158)

Note 1: The key in question (did:3:bafy...nana in this example) corresponds to the previous 3box account that is supposed to have logged out.
Note 2: I added links to the actual lines of code where the error is thrown. The line numbers don't match exactly.
Note 3: Clearing localStorage doesn't seem to solve this issue.

To Reproduce

  1. Run the example app from this repo:
    a. git clone https://github.com/3box/3box-js
    b. cd 3box-js/example
    c. npm ci
    d. npm run example:start
  2. On a browser with Metamask, head to http://localhost:30000. Unlock your MetaMask account. Press [F12] to open the developer console.
  3. Click on the "Auth 3box" button. Complete the login process. Wait until you are logged in.
  4. Click on the "Logout from 3box" button. Wait until you are logged out.
  5. Open your Metamask. Select a different account. Make sure this new account is not linked with the 3box account you just logged out of.
  6. Refresh the page.
  7. Click on the "Auth 3box" button. The error appears in the console. You do not appear to be logged in with your new account.

Expected behavior
Users should be able to log out of a 3box account and then log in to a different 3box account.

Screenshot
3boxError

Desktop:

  • OS: Ubuntu 20.04.1 LTS
  • Browser: Google Chrome
  • Version 85.0.4183.83

I was also able to reproduce on Firefox Developer Edition 81.0b5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions