-
Notifications
You must be signed in to change notification settings - Fork 131
Expose complete reconnect mode cycle #694
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Expose complete reconnect mode cycle #694
Conversation
Just fyi my initial idea was to use it in conjunction with the global state so that we avoid changes in the reconnect state machine. I'm open to re-discussing this one cc @hiroshihorie |
b459344
to
a704de1
Compare
@bombruch can you confirm that the above solution may work for you first? |
@pblazej of corse it does. All below is based on assumption that
Consider 2 cases: First case) WiFi is turned off for a long period (~20 seconds). This case is covered with existing logic in LK SDK. As shortened logs look like:
Time to show reconnect UI.
Based on last 2 lines in logs above - there is info to hide reconnect UI Second case) WiFi is turned off for a short period (~5 seconds).
After WiFi connection is restored it can tell about With fix for second case I can clearly see logs like:
During preparation of this comment I noticed that I've broken your logic with Pls tell me your thoughts on all above. Thanks! |
a704de1
to
97c6e0a
Compare
Issue
@pblazej did an amazing job in #642 with exposing reconnect mode.
But it happens to give info when SDK goes into
.quick
or.full
reconnect but not back to normal connect state.So with current logic there is no way to get info when SDK establishes connection back and it is time to hide reconnect UI elements.
Solution
Expose full cycle for
ReconnectMode
. Since SDK uses Swift optional enumReconnectMode?
there is no way to notify ObjC delegate with changes. Idea is to present.none
ReconnectMode option and use it instead of optional. With such approach it is feasible to notify ObjC delegates. With such logic SDK can tell clients that reconnection process is over. Still not sure wether.none
is the best name for such option so may be reviewers could suggest any better.