-
Notifications
You must be signed in to change notification settings - Fork 532
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(client-presence): update connectivity checks #22580
fix(client-presence): update connectivity checks #22580
Conversation
Checking runtime.clientId only determines if ever connected. runtime.connected reveals current state.
@@ -178,7 +178,7 @@ export class PresenceDatastoreManagerImpl implements PresenceDatastoreManager { | |||
forceBroadcast: boolean, | |||
): void => { | |||
// Check for connectivity before sending updates. | |||
if (this.runtime.clientId === undefined) { | |||
if (!this.runtime.connected) { |
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.
Should we check for both? Or is the runtime.connected check sufficient?
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.
Just connected is sufficient here. Once ever connected, clientId will be defined henceforth. (Which is how we got the bug.)
⯅ @fluid-example/bundle-size-tests: +245 Bytes
Baseline commit: 2f7a9d0 |
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.
LGTM 🚢
Checking runtime.clientId only determines if ever connected. runtime.connected reveals current state.