-
Notifications
You must be signed in to change notification settings - Fork 535
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
test(client-presence): old collateral connection and stale connection tests #23351
Conversation
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.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
packages/framework/presence/src/internalTypes.ts:54
- The event names 'connected' and 'disconnected' should be consistent with the rest of the codebase.
export interface EphemeralRuntimeEvents extends IEvent {
packages/framework/presence/src/test/mockEphemeralRuntime.ts:121
- The removal of the 'on' and 'off' methods from 'MockEphemeralRuntime' might break existing code that relies on these methods. Confirm if this change was intentional and if it might cause any issues.
public clientId: string | undefined;
packages/framework/presence/src/test/mockEphemeralRuntime.ts:71
- [nitpick] Ensure that the new event handling mechanism is consistent with the rest of the codebase and aligns with existing conventions.
extends TypedEventEmitter<EphemeralRuntimeEvents>
Updated the tests a bit from our last discussion, looking for some guidance around better ways to simulate reconnect since I now know we want to move away from TypedEventEmitter @jason-ha |
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.
I like a lot - still have notes :)
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.
few more suggestions
@jason-ha Thanks for approval, but added some stuff from the feedback that definitely requires additional review before merging:
|
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.
"stale" attendee needs a better descriptor or a comment in code. There isn't anything explaining what that is. (How do I check that there is also a test case for a non-stale attendee? What is the difference?)
Please also update the test case list in PR description.
I added a description of the stale connection scenario before the tests. I also did not like the wording from "stale attendee" to "attendee with stale connection". We're waiting to change the connection status of the attendee, so it feels like that's the actual part getting "stale". Can switch back if the conciseness if preferred. |
## Description [ADO Bug 24395](https://dev.azure.com/fluidframework/internal/_workitems/edit/24395) This PR enables the previously failing tests presence attendee tests as well as the new ones added in this PR: #23351 When the local attendee disconnects, we temporarily lose connectivity status for remote attendees. To fix this we mark all 'Connected' remote attendee connections as stale upon reconnect and update their status to disconnected after 30 seconds of inactivity. This PR also fixes some spelling mistakes: "seassionId-2" to "sessionId-2" --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
There are 6 tests that are added (and disabled) in this PR.
The first test is to verify that old collateral connections do not effect the connection status of remote attendees. This scenario was written as an edge case to old solution where old connection information sent in a join response would result in the attendee connection status being set to 'Disconnected'.
The next five have to do with stale remote attendee's connection status upon local client reconnect scenarios:
I added connect() and disconnect() function to MockEphemeralRuntime that manipulates the connection state of the local client.