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

fix: improve reconnect logic. #654

Merged
merged 5 commits into from
Dec 17, 2024
Merged

Conversation

cloudwebrtc
Copy link
Contributor

No description provided.

@cloudwebrtc cloudwebrtc marked this pull request as ready for review December 10, 2024 06:43
@bcherry bcherry self-requested a review December 10, 2024 07:23
Copy link

@bcherry bcherry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include a brief description of the uncovered issue and why this is the right fix?

@cloudwebrtc
Copy link
Contributor Author

cloudwebrtc commented Dec 10, 2024

The issue is mainly in this line https://github.com/livekit/client-sdk-flutter/pull/654/files#diff-4f309ad728e5eb8ca71a10a7283647e36936b53dc0feeb8d18edf03d3eb0d920L817. When the webrtc pc connection fails completely, fullReconnect will be triggered, but here it should clean up the signaling connection and restart to republish loca tracks. However, sending a leave request will cause the client to disconnect and be unable to restore the connection.

@@ -116,8 +118,6 @@ class SignalClient extends Disposable with EventsEmittable<SignalEvent> {

if (_connectivityResult.contains(ConnectivityResult.none)) {
logger.warning('no internet connection');
events.emit(SignalDisconnectedEvent(
Copy link
Contributor Author

@cloudwebrtc cloudwebrtc Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to emit a SignalDisconnectedEvent event here, because connect or resumeConnect/restartConnect will catch the ConnectException and take the correct follow-up action.

@cloudwebrtc cloudwebrtc merged commit 6ae73bc into main Dec 17, 2024
8 checks passed
@cloudwebrtc cloudwebrtc deleted the fix/improve-reconnect-logic branch December 17, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants