Skip to content

fix: use disconnect() instead of clearActiveAccount() for Beacon logout#143

Merged
hui-an-yang merged 2 commits intomainfrom
fix/use-disconnect-for-beacon-logout
Mar 3, 2026
Merged

fix: use disconnect() instead of clearActiveAccount() for Beacon logout#143
hui-an-yang merged 2 commits intomainfrom
fix/use-disconnect-for-beacon-logout

Conversation

@jevonearth
Copy link
Contributor

Summary

  • Replace wallet.value.client.clearActiveAccount() with wallet.value.disconnect() in the BeaconWallet disconnect path
  • Remove the manual peer removal loop (redundant, destroy() handles it)
  • Remove dead clearActiveAccount from ProgrammaticWallet type and mock objects
  • Remove unused ExtendedPeerInfo import

clearActiveAccount() only removes the active account reference but leaves beacon:matrix-selected-node and other Beacon state in localStorage. When a cached relay node goes offline, users get permanently stuck until they manually clear browser storage. disconnect() calls client.destroy(), which clears all beacon:* keys.

Related: ecadlabs/taquito#3329, ecadlabs/taquito#3330

Test plan

  • Connect via Beacon wallet, disconnect, verify all beacon:* keys are removed from localStorage
  • Reconnect after disconnect to confirm clean session establishment
  • Verify WalletConnect and Ledger disconnect paths are unaffected

…or Beacon logout

clearActiveAccount() only removes the active account reference but leaves
beacon:matrix-selected-node and peer data in localStorage. When a cached
relay node goes offline, users get permanently stuck until they manually
clear browser storage.

disconnect() calls client.destroy() which clears all beacon:* keys,
making it the correct method for logout. The manual peer removal loop
is also unnecessary since destroy() handles that.

Fixes ecadlabs/taquito#3329
@jevonearth jevonearth requested a review from hui-an-yang March 2, 2026 20:46
@hui-an-yang hui-an-yang merged commit 10f9c46 into main Mar 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants