Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between Swift and JS implementations of Sign.instance.update #1344

Open
simonmcl opened this issue Apr 15, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@simonmcl
Copy link

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:

  1. Go to a dApp on a browser
  2. Connect to it with a web wallet
  3. Close the dApp window
  4. Change the wallet address for the session, it will update
  5. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants