You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Web3Modal determines the session by simply grabbing the first available session from getSessions(). This works when the only session is the connected wallet, it does NOT work when we are managing multiple sessions (such as in the case when you are using both Web3Modal to connect a wallet and connecting dApps as well)
SDK Version
Client: iOS-Swift
Version All versions, including latest version 1.5.2
To Reproduce
Connect a wallet using web3modal
Connect a dApp to the same application using Pair.instance.pair(...)
Attempt to change network using Web3Modal.selectChain() , this will fail as the requests are being routed to the wrong session
Expected behaviour
The change network request should be sent to the wallet session. The web3Modal should manage its connected wallet session correctly.
marctatham
changed the title
Web3Modal uses wrong session when sending requests or for selecting a different chain
Web3Modal uses wrong session when selecting a different chain
Sep 3, 2024
Describe the bug
Web3Modal determines the session by simply grabbing the first available session from getSessions(). This works when the only session is the connected wallet, it does NOT work when we are managing multiple sessions (such as in the case when you are using both Web3Modal to connect a wallet and connecting dApps as well)
SDK Version
To Reproduce
Pair.instance.pair(...)
Web3Modal.selectChain()
, this will fail as the requests are being routed to the wrong sessionExpected behaviour
The change network request should be sent to the wallet session. The web3Modal should manage its connected wallet session correctly.
Screenshots
N/A
Device:
Additional context
The exact problem can be found in how the session is determined here:
web3modal-swift/Sources/Web3Modal/Core/Web3Modal.swift
Lines 37 to 48 in 2d94ebc
The text was updated successfully, but these errors were encountered: