Difference between Swift and JS implementations of Sign.instance.update
Describe the bug I'm working on a swift version of a wallet that also has a web version. A tester noticed a difference in behaviour when updating sessions (e.g. changing address). On Swift if the dApp is closed (closed the tab/browser window) updating a session update has no effect to the local storage, the dApp must be opened to acknowledge the response before anything happens locally. The next time the dApp is opened, all the updates come through. On web this is not the case, the local session object is updated immediately whether the remote dApp is open or not
In the Swift app, this gives the appearance that the app is broken, as no error is returned/presented. The update just appears to have no effect
Swift:
Task {
do {
try await Sign.instance.update(topic: existingSession.topic, namespaces: newNamespaces)
self.viewModel.refresh(animate: true)
} catch {
self.windowError(withTitle: "error".localized(), description: error.localizedDescription)
}
}
Web:
await this.client.update({ topic, namespaces });
this.refresh();
SDK Version
- Client: Swift, JS/TS
- Version: Swift 1.10.0-1.18.4, web sign client 2.7.0
To Reproduce Steps to reproduce the behavior:
- Go to a dApp on a browser
- Connect to it with a web wallet
- Close the dApp window
- Change the wallet address for the session, it will update
- Repeat process with a mobile app, it will not update until dApp is opened again
Expected behavior SDKs should match, both should be able to update without the dApp open