Skip to content

Bug: Reconnecting after a page refresh can return stale session state (connected UI but requests fail) #1842

@anorak-rums

Description

@anorak-rums

Describe the bug

After refreshing the page, applications using coinbase-wallet-sdk may incorrectly treat the wallet as already connected based on cached or persisted session state. However, the underlying provider session is not always fully re-established, which can cause subsequent requests to fail even though the UI indicates an active connection.

Steps

  1. Go to a web app that uses coinbase-wallet-sdk and shows a “connected” state when a wallet session exists.
  2. Connect Coinbase Wallet and confirm requests (e.g., eth_accounts, eth_chainId) succeed.
  3. Refresh the browser page (or close and reopen the tab) and let the app auto-initialize the SDK again.
  4. Observe that the UI may show the wallet as “connected” immediately based on cached/session state.
  5. Try sending a request (e.g., eth_sendTransaction or personal_sign) without manually reconnecting.
  6. See that the request can fail because the underlying session/provider is not actually active, or the SDK requires a fresh handshake.

Expected behavior

After a refresh, the SDK should either (a) re-establish the session reliably before reporting “connected”, or (b) report a disconnected state until the provider is fully ready. Apps should not end up in a “connected but unusable” state where requests fail unexpectedly.

Version

No response

Additional info

No response

Desktop

No response

Smartphone

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions