Skip to content
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): disabled (failing) attendees unit tests #23419

Merged
merged 9 commits into from
Jan 17, 2025

Conversation

WillieHabi
Copy link
Contributor

@WillieHabi WillieHabi commented Jan 2, 2025

Description

ADO Bug 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"

@Copilot Copilot bot review requested due to automatic review settings January 2, 2025 18:19
@github-actions github-actions bot added base: main PRs targeted against main branch area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct labels Jan 2, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

packages/framework/presence/src/test/presenceManager.spec.ts:83

  • The word 'seassionId-2' is misspelled. It should be 'sessionId-2'.
presence = prepareConnectedPresence(runtime, "seassionId-2", "client2", clock, logger);

packages/framework/presence/src/systemWorkspace.ts:202

  • The newly introduced behavior for handling stale connections using 'staleConnectionTimer' is not covered by tests.
this.staleConnectionTimer.setTimeout(() => {

packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jason-ha jason-ha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking promising

packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
Comment on lines 457 to +459
presence.events.on("attendeeDisconnected", (attendee) => {
disconnectedAttendees.push(attendee);
if (attendee !== presence.getMyself()) {
remoteDisconnectedAttendees.push(attendee);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we announce ourselves when disconnecting. Do we have a test for that? I don't think we do, but we should. Task for after.

@WillieHabi WillieHabi requested a review from jason-ha January 14, 2025 18:08
Copy link
Contributor

@jason-ha jason-ha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good. Minor notes and then question about self in staleConnectionClients.

packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
@WillieHabi WillieHabi requested a review from jason-ha January 16, 2025 21:43
Copy link
Contributor

@jason-ha jason-ha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for slower response - got distracted and didn't look up the work item number for the TODO and then failed to post.

packages/framework/presence/src/systemWorkspace.ts Outdated Show resolved Hide resolved
@WillieHabi WillieHabi requested a review from jason-ha January 17, 2025 18:33
@WillieHabi WillieHabi merged commit 3e36525 into microsoft:main Jan 17, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants