← Index
Source: docs/issues/issue-63-improper-wallet-disconnection-and-missing-network-enforcemen.md (auto-generated by scripts/generate-docs-html.mjs — edit the .md, not this file)

Improper Wallet Disconnection and Missing Network Enforcement

Issue #63 | State: OPEN | Created: 2026-01-18T10:02:40Z

Assignees: Abdulkarim4u

Updated: 2026-01-22T00:41:28Z | Closed: N/A


Description

The current wallet connection implementation (useWallet hook) does not support a true "reconnection" flow or network enforcement. Currently, if a user is connected to an unintended network (e.g., BSC Mainnet) and attempts to fix it by disconnecting and reconnecting, the application fails to resolve the state correctly.

Current Behavior

  1. Shallow Disconnect: The disconnect function only resets the local React state (isConnected: false, address: null). It does not terminate the session with the EIP-1193 provider (MetaMask).
  2. Automatic Re-login: Clicking "Connect" again immediately pulls the previous (wrong) configuration because the provider's internal session is still active.
  3. No Network Validation: The application does not check if the current chainId matches the required network (BSC Testnet / ID: 97) and doesn't prompt the user to switch chains.

Steps to Reproduce

  1. Connect MetaMask to BSC Mainnet.
  2. Click "Connect Wallet" on the Nostra app.
  3. App shows "BSC" instead of "BSC Testnet" in the wallet dropdown.
  4. Click "Disconnect".
  5. Click "Connect Wallet" again.
  6. The app instantly connects back to BSC Mainnet without prompting for a change.

Expected Behavior

Technical Context


Comments

@Abdulkarim4u — 2026-01-22T00:41:28Z

Oh Great i will take a look and start working on it