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

[Bug fix] CallId switch losing participants fix #5725

Merged
merged 10 commits into from
Mar 27, 2025

Conversation

dmceachernmsft
Copy link
Member

What

Fix issue where useAdaptedSelector is using a stale callId when the callId updates in the call when joining a group call

Why

Resolves an issue where the participant loses the other people in the call until the next state change in the adapter

https://skype.visualstudio.com/SPOOL/_workitems/edit/4005860

How Tested

Validated locally

@@ -68,7 +62,7 @@ export const useSelectorWithAdaptation = <
if (!mounted.current) {
return;
}
const newProps = selector(adaptState(state), selectorProps ?? callConfigProps);
const newProps = selector(adaptState(state), selectorProps ?? { callId: state.call?.id });
Copy link
Member

Choose a reason for hiding this comment

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

I assume it's ok { callId: state.call?.id } will be a new object each time selector is called, but perhaps we should check that selector from reselect doesn't require the props to be memoized

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking at their docs for create selector it does not seem that they need anything to be memoized. they have lots of options to memoize the selector though
https://reselect.js.org/api/createSelector

Copy link
Member

Choose a reason for hiding this comment

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

Just verified this, put a console log inside the if (propRef.current !== newProps) { (and one in an else to that) and validate there is no difference if a cached { callId } is used vs creating the callId object each pass 👍

Copy link
Contributor

Copy link
Contributor

github-actions bot commented Mar 20, 2025

@azure/communication-react jest test coverage for stable.

Lines Statements Functions Branches
Base 29300 / 46001
63.69%
29300 / 46001
63.69%
808 / 1476
54.74%
2407 / 3826
62.91%
Current 29300 / 46001
63.69%
29300 / 46001
63.69%
808 / 1476
54.74%
2407 / 3826
62.91%
Diff 0 / 0
0%
0 / 0
0%
0 / 0
0%
0 / 0
0%

Copy link
Contributor

github-actions bot commented Mar 20, 2025

@azure/communication-react jest test coverage for beta.

Lines Statements Functions Branches
Base 58476 / 94476
61.89%
58476 / 94476
61.89%
1180 / 2698
43.73%
3536 / 5834
60.61%
Current 58444 / 94470
61.86%
58444 / 94470
61.86%
1180 / 2698
43.73%
3495 / 5813
60.12%
Diff -32 / -6
-0.03%
-32 / -6
-0.03%
0 / 0
0%
-41 / -21
-0.49%

Copy link
Contributor

Copy link
Contributor

Copy link
Contributor

Copy link
Contributor

Copy link
Contributor

@dmceachernmsft dmceachernmsft enabled auto-merge (squash) March 27, 2025 15:58
Copy link
Contributor

CallWithChat bundle size is not changed.

  • Current size: 12401048
  • Base size: 12401048
  • Diff size: 0

Copy link
Contributor

Calling bundle size is not changed.

  • Current size: 12401036
  • Base size: 12401036
  • Diff size: 0

Copy link
Contributor

Chat bundle size is not changed.

  • Current size: 1775237
  • Base size: 1775237
  • Diff size: 0

Copy link
Contributor

@dmceachernmsft dmceachernmsft merged commit 013de1f into main Mar 27, 2025
41 checks passed
@dmceachernmsft dmceachernmsft deleted the dmceachernmsft/callid-fix branch March 27, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants