-
Notifications
You must be signed in to change notification settings - Fork 4
Handling tab visibility in getNextConnectionState #469
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
… when tab is visible again
|
Preview build will be at |
|
I find this change hard to understand. Can you write a bit more explanation (on the PR in the first instance) ? Do you think there's something different we could do in the connection library to simplify the code here / remove special cases? |
Have added more explanation in the PR description. Hope that helps!
Possibly? One way I can think of is if we introduced new connection status(es) that can distinguish between reason behind different disconnected states maybe (e.g. disconnected explicitly by user, connection loss, connect error, tab switching)? But on the other hand, I'm not sure if the connection library should be aware of these reasons if it was a general-use library |
|
Possibly can handle another tab visibility issue as well (private link to issue: https://microbit-global.monday.com/boards/1550536443/pulses/1696956864) |
| // If bridge micro:bit causes radio bridge reconnect to fail twice | ||
| hasAttempedReconnect | ||
| ) { | ||
| setHasAttemptedReconnect(false); |
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.
Letting hasStartedOver logic handle the resetting of this instead for when reconnect fail twice. Also, important to setOnFirstConnectAttempt(true) for attempts after reconnect fail twice to avoid reconnect fail twice error dialog from being triggered again in subsequent start over connection attempt errors
|
Thanks for working through this one. |
onFirstConnectAttemptandhasAttemptedReconnectPrivate link to related issues: