Skip to content

[bug] Unhandled stale-session errors: 'No matching key' + setDefaultChain chainChanged fallout #5545

@PaulRBerg

Description

@PaulRBerg

Link to minimal reproducible example

https://app.sablier.com (public production app repro; not minimal yet)

Steps to Reproduce

  1. Open https://app.sablier.com.
  2. Connect a wallet through AppKit.
  3. Let the tab sit for a while or disconnect/reconnect wallet state.
  4. Trigger a network change (including chain switching paths that emit chainChanged).
  5. Check browser console.

Summary

We are consistently seeing unhandled promise rejections from WalletConnect/AppKit internals in production:

  • No matching key. session topic doesn't exist: <topic>
  • TypeError: Cannot read properties of undefined (reading 'setDefaultChain')

The second error appears immediately after stale session-topic validation failures. We traced this to session-event/update processing and chain-change handling (onSessionUpdateRequest/isValidSessionTopic followed by onChainChanged -> setDefaultChain path).

Expected behavior:

  • stale/deleted session topics should be handled internally without unhandled rejections
  • chainChanged handling should not attempt setDefaultChain on an undefined provider/session state

Actual behavior:

  • both errors surface as unhandled rejections and spam prod console/Sentry unless explicitly filtered

List of related npm package versions

  • @reown/appkit@1.8.18
  • @reown/appkit-adapter-solana@1.8.18
  • @reown/appkit-adapter-wagmi@1.8.18
  • @walletconnect/universal-provider@2.23.2 (transitive)
  • @walletconnect/sign-client@2.23.2 (transitive)
  • wagmi@2.19.5
  • viem@2.45.2
  • next@16.1.6
  • react@19.2.4

Node.js Version

v25.6.0

Package Manager

bun@1.3.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions