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

Production outages: Swift SDK not attempting to connect socket #45

Closed
simonmcl opened this issue Oct 29, 2024 · 8 comments
Closed

Production outages: Swift SDK not attempting to connect socket #45

simonmcl opened this issue Oct 29, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@simonmcl
Copy link

simonmcl commented Oct 29, 2024

Describe the bug
I posted an issue in the ReOwn discord last night here: https://discord.com/channels/492410046307631105/1300526584368730173 We had an outage last night where our web and iOS wallets stopped connecting to the wallet connect server. Web received an origin error, and was able to resolve it by whitelisting the domain in the ReOwn dashboard (this wasn't required previously). iOS was unable to solve the issue by adding bundle id's to the dashboard. The Swift SDK is also not reporting any error, simply reporting that the socket is disconnected (FYI, this is walletConnect v1.19)

After many hours of trying to debug the issue, we discovered that the Swift SDK was not attempting to connect the socket. No call to socket.connnect() was triggering a breakpoint in the debugger (some details in discord). Ultimately due to experimentation we solved the issue when the web developer tested removing the domain verification on the dashboard. Both web and iOS returned to normal

I've just switched my local branch back to a version working on migrating to ReOwn and I am now seeing the same issue locally. ReOwn SDK is not calling .connect, and the SDK is sitting stuck in a disconnected state. This appears to happen when the app has no active sessions on launch. It was working fine when I had two. I tested disconnecting them, restarted the app and now it won't connect. My wallet connect buttons are disabled due to the socket being disconnected so I can't reconnect. I added a second button to try activate the connection, and yes if I try to pair, the socket wakes back up and starts trying to connect

SDK Version

  • Client: Swift
  • Version: 1.0.4
@llbartekll
Copy link
Collaborator

ReOwn SDK is not calling .connect, and the SDK is sitting stuck in a disconnected state. This appears to happen when the app has no active sessions on launch. It was working fine when I had two. I tested disconnecting them, restarted the app and now it won't connect. My wallet connect buttons are disabled due to the socket being disconnected so I can't reconnect. I added a second button to try activate the connection, and yes if I try to pair, the socket wakes back up and starts trying to connect

that's expected, we optimised the socket connection, so when wallet does not require it, we won't waste the resources. You should update your UI to not block the buttons based on socket connection state.

@simonmcl
Copy link
Author

@llbartekll ok i'll have a look at doing this. We added this as a means to warn our users that the socket wasn't connected, as we've faced an issue of the automatic connection handler getting stuck and not reconnecting. We'll try test and see if this is improved

@llbartekll
Copy link
Collaborator

do you use URLSession or Starscream?

@simonmcl
Copy link
Author

@llbartekll currently starscream, but I want to resurrect an attempt to switch to URLSession as we had multiple crashes from starscream over the weekend

@llbartekll
Copy link
Collaborator

as we had multiple crashes from starscream over the weekend

on which sdk version? do you want to share stack trace?

@simonmcl
Copy link
Author

@llbartekll version 3.1.2 of starscream. pretty sure its the same issue as this: WalletConnect/WalletConnectSwiftV2#1394

To clarify, the crashes were in production, which is still using WalletConnect, I haven't fully migrated to ReOwn yet

Screenshot 2024-10-29 at 14 54 57

@llbartekll
Copy link
Collaborator

which is still using WalletConnect

ok, just wanted to know if it's something new from this repo
thanks

@simonmcl
Copy link
Author

closing this one as removing the spinner and allowing access to scanner does seem to resolve the issue for now. Will open another ticket if we get reports of the automatic socket connection throwing errors with the new lib

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