-
Notifications
You must be signed in to change notification settings - Fork 698
websocket refactor for improved connection reliability #1664
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
Conversation
✅ Heimdall Review Status
|
70f5fe1 to
186d887
Compare
186d887 to
646466a
Compare
| throw new Error('webSocket object is not null'); | ||
| } | ||
| if (this.isDisconnecting) { | ||
| throw new Error('WebSocket is disconnecting, cannot reconnect on same instance'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: reconnect => connect for consistency with the function name we're in
fan-zhang-sv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Tested locally against both spencer's hosted commerce site + locally hosted playground
- desktop to mobile
- mobile to mobile
tested delaying approval for 10+ second, all test cases went thru, so lit
| const address = await this.cipher.decrypt(encryptedEthereumAddress); | ||
| this.listener?.accountUpdated(address); | ||
| } catch { | ||
| // Had error decrypting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we output these errors anywhere? Failing silently is a bit concerning
Summary
This set of fixes specifically targets reliability on mobile-mobile flows. It speeds up and fixes things in the reconnect process for our walletlink websockets.
Connection Management:
Heartbeat:
Browser Event Handling:
How did you test your changes?
manually
Also tested for regressions on long-idle desktop chrome tabs (Will's service worker fix):
Also built locally and tested the playground, extension, desktop to mobile
Failure 1 (before fixes)
commercefail1.mp4
Failure 2 (before fixes)
commercefail2.mp4
Success with fixes
commercesuccess1.mp4