Skip to content

fix(breakout): keep history csis for meeting members#5023

Open
WeijuanShao wants to merge 7 commits into
webex:nextfrom
WeijuanShao:fix/remember-history-csis
Open

fix(breakout): keep history csis for meeting members#5023
WeijuanShao wants to merge 7 commits into
webex:nextfrom
WeijuanShao:fix/remember-history-csis

Conversation

@WeijuanShao

@WeijuanShao WeijuanShao commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

COMPLETES #< INSERT LINK TO ISSUE >

This pull request addresses

Cache history csis information for case that: host end breakouts and host return to main earlier than other panelists, there may exist a time gap between homer video layout users and locus users.
Csis are meeting-level identifiers. When a user switches between a BO session and the main session, their CSIs are not regenerated. So, to bridge this time gap, we should still be able to use the existing CSIs to match the member in findMemberByCsi, allowing media users to resolve the correct member even while the member data in the main session is temporarily incomplete.

by making the following changes

< DESCRIBE YOUR CHANGES >

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@WeijuanShao WeijuanShao requested review from a team as code owners June 5, 2026 07:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d643c44e9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/@webex/plugin-meetings/src/members/index.ts Outdated
Comment thread packages/@webex/plugin-meetings/src/members/index.ts Outdated
@WeijuanShao WeijuanShao changed the title fix(breakout): keep history csis for members fix(breakout): keep history csis for meeting members Jun 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b32a862948

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +586 to +589
const history = new Set<number>();
MemberUtil.extractCsis(existingMember.participant).forEach((csi) => history.add(csi));
if (history.size > 0) {
this.historyCsisByMemberId.set(memberId, history);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Merge cached CSIs on removal

Fresh evidence beyond the earlier thread is that this newly added removal path overwrites any existing CSI history for the member. When a member already has cached CSIs from an earlier update and the later removedParticipantIds delta still has a current/partial CSI set, this replaces the old set with only the CSIs extracted at removal time, so findMemberByCsi can no longer resolve delayed media-layout CSIs after the member is re-added with incomplete devices; the new unit case named “merges existing history with CSIs captured at removal time” exercises this sequence as well.

Useful? React with 👍 / 👎.

const history = new Set<number>();
MemberUtil.extractCsis(existingMember.participant).forEach((csi) => history.add(csi));
if (history.size > 0) {
this.historyCsisByMemberId.set(memberId, history);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we're overwriting the history entry here, instead we should be adding new CSIs to it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't this introduce redundant data? If a signed-in user joins the meeting again, the CSI generated during the first join would already be invalid. I'm not sure whether an expired CSI could later be reused by another participant.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes, actually, you're right, if CSIs change we shouldn't really need the old ones for anything.

Comment thread packages/@webex/plugin-meetings/src/members/index.ts Outdated
* and re-added (e.g. when entering/leaving a breakout session).
* @private
*/
private historyCsisByMemberId: Map<string, Set<number>> = new Map();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: we're only using this to find a member for a specific csi, so maybe instead of having a map of sets we could just have a map where the keys are CSI and values are memberId? It would also simplify the code:

for storing it, we would just call:
historyCsisByMemberId.set(csi, member.id)
and that's it no other checks or code needed

and for reading it:
memberId=historyCsisByMemberId.get(csi)
and that's it, no for loop or anything else

what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered that approach as well. Personally, I feel that using memberId as the key provides a more member-centric view of the data, which makes the overall data model clearer.

That said, I agree that using the data can be more convenient when csi is the key. If you think using csi as the key is the better approach, I'm happy to switch to that instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The main downside of current approach is that we have to loop over all the entries in findMemberByCsi() - when we have a 1k meeting or in the future 5k meetings in theory we may have to be doing a loop over thousands of members and findMemberByCsi() is called whenever the person shown in one of video panes changes, so that can be quite often in a large meeting where more than 6 people are speaking (although maybe in practice not all members will have entries in historyCsisByMemberId?), so that's the main reason why I think using csi as key would be better.

Comment thread packages/@webex/plugin-meetings/src/members/index.ts Outdated
@marcin-bazyl marcin-bazyl added the validated If the pull request is validated for automation. label Jun 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 948d193e9b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/@webex/plugin-meetings/src/members/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants