-
Notifications
You must be signed in to change notification settings - Fork 90
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
Re-connect #29
Comments
This seems like it may be a I wonder if the connection failure can be detected by Trystero and so that it can attempt to reconnect? If not, |
Considering this:
I don't think this is a failure mode that Trystero or application code can handle. It seems that Trystero is appropriately cleaning up Lines 324 to 330 in 78a65e7
Line 24 in 78a65e7
Lines 253 to 262 in 78a65e7
Lines 223 to 231 in 78a65e7
So, it doesn't look like there's much that Trystero can do if leaving and rejoining the room doesn't fix the connection. According to the WebRTC spec, a "failed" state is terminal:
Luckily, there appears to be a So, it seems that EDIT: There appears to be prior art that we may be able to use for implementing ICE restarts here: https://github.com/feross/simple-peer/pull/771/files |
The entire process cannot be restarted upon identification of the failure? I mean from the side of the suspended client. |
I'm not sure. It would probably take some experimentation. What I'm struggling with is how to trigger an ICE candidate failure so that error handling could be tested and debugged. Do you have a reliable way of doing that? |
I experienced this issue again today. I noticed in Chrome's chrome://webrtc-internals/ page that there were four connections that I couldn't get rid of via I need to spend more time to better understand Trystero's connection lifecycle, but I noticed this Line 242 in 78a65e7
It is called upon peer Line 126 in 78a65e7
Line 152 in 78a65e7
I wonder if this could be bound to the @dmotz do you thoughts about handling error events by calling |
I'm able to reliably reproduce the error state with two computers. On one computer, I just disable WiFi, wait 30-60 seconds, and turn it back on. The two peers can no longer connect. Leaving and rejoining the room on either computer doesn't reestablish connection. However, I noticed that if both computers leave and rejoin the room, connection can successfully be reestablished. Sometimes it takes more than one try to leave and rejoin the room. This suggests that the re-connection issue can be addressed within Trystero. It's worth exploring what the leave action is doing to clean up connections and see if it can be reused during a live connection as peers cycle in and out of the room. |
Sadly, no. The same sequence of events still did not lead to a re-connection. I suspect one of the peers is trying, but no the other. |
This is consistent with my experience on mobile, even with this fix. There appears to be some number of iOS-specific issues left to deal with, so we will have to iterate on a full solution for this issue. Does #30 at least improve reconnection success for you on desktop Chrome and Firefox? |
@jeremyckahn Yes, #30 improves leave/rejoin behavior between desktop browsers. Thanks! |
That's great to hear! Thanks for testing @tomberek. If #30 seems good to @dmotz, I recommend merging and releasing the change when it's convenient but leaving this issue open. I predict that this problem will take time and iteration to truly solve, but it can be gradually improved over time with incremental fixes. |
fix: (#29) Replace offer when peer is disconnected
I released the related PR as 0.11.8. I haven't had a chance to look into this much yet, but will try to explore soon. It may be worth doing some tests with the Firebase strategy to determine whether the problem lies on the matchmaking side or the WebRTC library side. If it's the latter I'm open to finding a new RTC connection management lib or building one in. |
Thank you for the 0.11.8 release, @dmotz!
That's a great idea. I've only used the WebTorrent strategy so far so I don't know how its reliability might compare to Firebase in practice. I've noticed that clients are generally able to connect to WebTorrent servers and exchange SDPs. I think the remaining issues (at least on desktop browsers) are specific longer-running sessions, which is going to be challenging to reproduce and debug. I think the iOS issues are a result of limitations that Apple has built in paired with platform-specific bugs. For example: There may be only so much we can do for iOS until Apple fixes their platform-level issues. 😕 In case it's helpful, https://www.farmhand.life/#online/global (source) is running my Trystero branch (which, at the time of this comment, is in sync with the 0.11.8 release). I leave sessions running for days at a time, which is how I can observe the issues related to longer-lived sessions. It may be a helpful way to manifest issues for testing and debugging purposes. |
@jeremyckahn any updates on your experience? |
No, it's about the same since my last comment. I haven't been exploring connection improvements since then. |
I'm getting some re-connection difficulties.
I attempted various combinations of
.leave()
and.joinRoom
without luck.The text was updated successfully, but these errors were encountered: