-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve Retry Mechanism and Listener Handling in ResumeTask #2602
base: master
Are you sure you want to change the base?
Conversation
…k was offline. This line triggered the _scheduleResume function even when the network was offline. Given the presence of the listener mechanism, this line is redundant and its removal is recommended to avoid unnecessary operations.
This line triggered the _scheduleResume function even when the networ…
Incrementing this._resumeRetryN within the _scheduleResume function ensures that the retry count is updated only when a resume task is actually scheduled. Previously, incrementing it in the schedule function could lead to unnecessary increments even when no retry task was initiated (e.g., due to conditions preventing _scheduleResume from being called). This change makes the retry count logic more accurate and aligned with actual resume attempts, improving the reliability of the retry mechanism.
Hi, thanks for your contribution! |
Hi @saghul I have signed the CLA. kindly review my PR now |
Both of the changes break the logic in subtle ways.
In order for the retry count check to work, the counter needs to be accurate when we call
It's not unnecessary. There are network glitches that will cause the connection to break while the network state doesn't transition to offline, so we cannot assume |
I observed that with this line NetworkInfo.isOnline() && this._scheduleResume();, the _scheduleResume function is triggered even when the internet is disconnected. Normally, it should not trigger the _scheduleResume function immediately when the internet is lost. What solution should be applied here, in your opinion? @saghul |
I think you are looking at this the wrong way. The real question is why does At the end of the day, it doesn't matter much. If your internet is down, but we retry, the connection will fail, and when the retry-count is exhausted, the reload mechanism will kick in. Otherwise you are going to be left in the meeting with no audio / video and wondering what's going on. What exactly are you trying to fix here? |
Improve Retry Mechanism and Listener Handling in
ResumeTask
This PR introduces two key improvements to the
ResumeTask
implementation:1. Move
this._resumeRetryN += 1
to_scheduleResume
:_scheduleResume
is not invoked.2. Remove unnecessary call to
_scheduleResume
inschedule
:_scheduleResume
was invoked inschedule
regardless of the network status, potentially causing attempts to reconnect even when the network was offline.These changes improve the accuracy and robustness of the retry mechanism and eliminate potential conflicts in listener handling.