Skip to content

[Bug]: Duplicate accounts for same address resulting in UI inconsistencies #33431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Gudahtt opened this issue Jun 2, 2025 · 0 comments
Open
Labels
needs-triage Issue needs to be triaged regression-prod-12.18.3 Regression bug that was found in production in release 12.18.3 team-accounts team-new-networks PRs from the New Networks team type-bug Something isn't working

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Jun 2, 2025

Describe the bug

When smoke testing v12.18.3, I was just able to create a duplicate Solana account somehow. On my test installation, there are now two entries for the same address in the AccountsController state, but with different names. As a result, I see an inconsistency in the UI for this account (the name is different on the Home screen than in the account list). The account only appears once in the list.

I was able to reproduce this on a slow machine my creating the Solana account very quickly, immediately after onboarding, before the suggested name populated.

Apparently this error case may be prevented on v12.20.0 by a change that prevents account creation before account discovery has completed. But there may be additional underlying problems here, and we still need to somehow fix things for users who have been impacted so far.

Expected behavior

  • It should be impossible to create two accounts with the same address
  • The "Create account" dialog should not remain open after creating an account
  • The name of an account in the account list should match what's shown on the Home screen

Screenshots/Recordings

Image Image

Steps to reproduce

The steps I took were:

  • Go through onboarding quickly, choosing "Create wallet", and skipping the SRP backup
  • Click "Create Solana account" when the Solana modal pops up after onboarding
  • At this point the "Create Account" dialog popped up, but I clicked "Create account" before the suggested name had populated (the field was empty).
  • Then there was a brief flash as the page re-rendered, and the dialog loaded again, but this time it had a preview value (Solana account 2). I clicked "Create account" again
  • Now I'm in the broken situation, where the account list entry is called "Snap account 2", but when it's selected, the home screen calls it "Solana Account 1"

Error messages or log output

No related console logs or errors

Detection stage

In production (default)

Version

12.18.3

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

Here are the `internalAccounts`, `keyrings`, `identities`, and `lostIdentities` properties from state logs:
    "internalAccounts": {
      "accounts": {
        "c06db0dc-affa-4d59-9ffa-2cb8f25c8ea1": {
          "id": "c06db0dc-affa-4d59-9ffa-2cb8f25c8ea1",
          "address": "0x289c4ce0495b3f8ee7165fd149cd402595ca0df6",
          "options": {
            "entropySource": "01JWS509PCZGSB90H0CEF4ZZ28",
            "derivationPath": "m/44'/60'/0'/0/0"
          },
          "methods": [
            "personal_sign",
            "eth_sign",
            "eth_signTransaction",
            "eth_signTypedData_v1",
            "eth_signTypedData_v3",
            "eth_signTypedData_v4"
          ],
          "scopes": [
            "eip155:0"
          ],
          "type": "eip155:eoa",
          "metadata": {
            "name": "Account 1",
            "importTime": 1748895803379,
            "lastSelected": 1748895920382,
            "keyring": {
              "type": "HD Key Tree"
            }
          }
        },
        "d8ac7691-32f6-40f3-92bc-957b008b4e07": {
          "type": "solana:data-account",
          "id": "d8ac7691-32f6-40f3-92bc-957b008b4e07",
          "address": "5atP5vRcLHojTSWwrqZBBqvHuCwnwhuEY3Svtv2YdGQ3",
          "options": {
            "entropySource": "01JWS509PCZGSB90H0CEF4ZZ28",
            "derivationPath": "m/44'/501'/0'/0'",
            "index": 0
          },
          "methods": [
            "signAndSendTransaction",
            "signTransaction",
            "signMessage",
            "signIn"
          ],
          "scopes": [
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
            "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
          ],
          "metadata": {
            "name": "Solana Account 1",
            "importTime": 1748895813664,
            "keyring": {
              "type": "Snap Keyring"
            },
            "snap": {
              "id": "npm:@metamask/solana-wallet-snap",
              "name": "Solana",
              "enabled": true
            },
            "lastSelected": 1748896734769
          }
        },
        "40ded190-5132-4959-85c4-6ae1acca94d6": {
          "type": "solana:data-account",
          "id": "40ded190-5132-4959-85c4-6ae1acca94d6",
          "address": "5atP5vRcLHojTSWwrqZBBqvHuCwnwhuEY3Svtv2YdGQ3",
          "options": {
            "scope": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "entropySource": "01JWS509PCZGSB90H0CEF4ZZ28",
            "derivationPath": "m/44'/501'/0'/0'",
            "index": 0
          },
          "methods": [
            "signAndSendTransaction",
            "signTransaction",
            "signMessage",
            "signIn"
          ],
          "scopes": [
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
            "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
          ],
          "metadata": {
            "name": "Snap Account 2",
            "importTime": 1748895822198,
            "keyring": {
              "type": "Snap Keyring"
            },
            "snap": {
              "id": "npm:@metamask/solana-wallet-snap",
              "name": "Solana",
              "enabled": true
            },
            "lastSelected": 1748895822199
          }
        },
        "38de9cfb-7f51-4843-91ac-a73bc0a10c68": {
          "type": "solana:data-account",
          "id": "38de9cfb-7f51-4843-91ac-a73bc0a10c68",
          "address": "D8Sa1oaTAKMCc6D8QNNdyXcAncnxVXDSh85NuCTuzRqb",
          "options": {
            "scope": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "entropySource": "01JWS509PCZGSB90H0CEF4ZZ28",
            "derivationPath": "m/44'/501'/1'/0'",
            "index": 1
          },
          "methods": [
            "signAndSendTransaction",
            "signTransaction",
            "signMessage",
            "signIn"
          ],
          "scopes": [
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
            "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
          ],
          "metadata": {
            "name": "Solana Account 3",
            "importTime": 1748895877402,
            "keyring": {
              "type": "Snap Keyring"
            },
            "snap": {
              "id": "npm:@metamask/solana-wallet-snap",
              "name": "Solana",
              "enabled": true
            },
            "lastSelected": 1748895932078
          }
        },
        "5ec4534c-a5f2-4175-90d5-e4733b0f8fa4": {
          "id": "5ec4534c-a5f2-4175-90d5-e4733b0f8fa4",
          "address": "0x2dca25a9786c7812c7a314556b8e0bf830ca957a",
          "options": {},
          "methods": [
            "personal_sign",
            "eth_sign",
            "eth_signTransaction",
            "eth_signTypedData_v1",
            "eth_signTypedData_v3",
            "eth_signTypedData_v4"
          ],
          "scopes": [
            "eip155:0"
          ],
          "type": "eip155:eoa",
          "metadata": {
            "name": "Account 2",
            "importTime": 1748895925706,
            "keyring": {
              "type": "HD Key Tree"
            },
            "lastSelected": 1748895925735,
            "nameLastUpdatedAt": 1748895925948
          }
        }
      },
      "selectedAccount": "d8ac7691-32f6-40f3-92bc-957b008b4e07"
    },
    "keyrings": [
      {
        "type": "HD Key Tree",
        "accounts": [
          "0x289c4ce0495b3f8ee7165fd149cd402595ca0df6",
          "0x2dca25a9786c7812c7a314556b8e0bf830ca957a"
        ],
        "metadata": {
          "id": "01JWS509PCZGSB90H0CEF4ZZ28",
          "name": ""
        }
      },
      {
        "type": "Snap Keyring",
        "accounts": [
          "5atP5vRcLHojTSWwrqZBBqvHuCwnwhuEY3Svtv2YdGQ3",
          "D8Sa1oaTAKMCc6D8QNNdyXcAncnxVXDSh85NuCTuzRqb"
        ],
        "metadata": {
          "id": "01JWS50E6AG1VT1GK0FBMYZZ7X",
          "name": ""
        }
      },
      {
        "type": "Ledger Hardware",
        "accounts": [],
        "metadata": {
          "id": "01JWS53GGR9T0W91ZPS1T16KH7",
          "name": ""
        }
      }
    ],
    "identities": {
      "0x289c4ce0495b3f8ee7165fd149cd402595ca0df6": {
        "address": "0x289c4ce0495b3f8ee7165fd149cd402595ca0df6",
        "name": "Account 1",
        "lastSelected": 1748895920382
      },
      "5atP5vRcLHojTSWwrqZBBqvHuCwnwhuEY3Svtv2YdGQ3": {
        "address": "5atP5vRcLHojTSWwrqZBBqvHuCwnwhuEY3Svtv2YdGQ3",
        "name": "Snap Account 2",
        "lastSelected": 1748895822199
      },
      "D8Sa1oaTAKMCc6D8QNNdyXcAncnxVXDSh85NuCTuzRqb": {
        "address": "D8Sa1oaTAKMCc6D8QNNdyXcAncnxVXDSh85NuCTuzRqb",
        "name": "Solana Account 3",
        "lastSelected": 1748895932078
      },
      "0x2dca25a9786c7812c7a314556b8e0bf830ca957a": {
        "address": "0x2dca25a9786c7812c7a314556b8e0bf830ca957a",
        "name": "Account 2",
        "lastSelected": 1748895925735
      }
    },
    "lostIdentities": {
      "0x289c4ce0495b3f8ee7165fd149cd402595ca0df6": {
        "address": "0x289c4ce0495b3f8ee7165fd149cd402595ca0df6",
        "name": "Account 1",
        "lastSelected": 1748895920382
      },
      "5atP5vRcLHojTSWwrqZBBqvHuCwnwhuEY3Svtv2YdGQ3": {
        "address": "5atP5vRcLHojTSWwrqZBBqvHuCwnwhuEY3Svtv2YdGQ3",
        "name": "Snap Account 2",
        "lastSelected": 1748895822199
      },
      "D8Sa1oaTAKMCc6D8QNNdyXcAncnxVXDSh85NuCTuzRqb": {
        "address": "D8Sa1oaTAKMCc6D8QNNdyXcAncnxVXDSh85NuCTuzRqb",
        "name": "Solana Account 3",
        "lastSelected": 1748895932078
      },
      "0x2dca25a9786c7812c7a314556b8e0bf830ca957a": {
        "address": "0x2dca25a9786c7812c7a314556b8e0bf830ca957a",
        "name": "Account 2",
        "lastSelected": 1748895925735
      }
    },

Severity

No response

@Gudahtt Gudahtt added the type-bug Something isn't working label Jun 2, 2025
@github-project-automation github-project-automation bot moved this to To be triaged in Bugs by team Jun 2, 2025
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Jun 2, 2025
@metamaskbot metamaskbot added needs-triage Issue needs to be triaged regression-prod-12.18.3 Regression bug that was found in production in release 12.18.3 labels Jun 2, 2025
@Gudahtt Gudahtt added team-accounts team-new-networks PRs from the New Networks team labels Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Issue needs to be triaged regression-prod-12.18.3 Regression bug that was found in production in release 12.18.3 team-accounts team-new-networks PRs from the New Networks team type-bug Something isn't working
Projects
Status: To be fixed
Status: To be triaged
Development

No branches or pull requests

2 participants