Skip to content

Commit

Permalink
Fix member removal bug and update user identification
Browse files Browse the repository at this point in the history
  • Loading branch information
ritikramuka committed Jan 29, 2024
1 parent 9a84d19 commit ee47c63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/web/client/common/worker/webworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ async function loadContainer(config, swpId, entityInfo) {
}

audience.on("memberRemoved", (clientId, member) => {
if (!existingMembers.get(member.userId)) {
if (!existingMembers.get(member.additionalDetails.AadObjectId)) {
self.postMessage({
type: "member-removed",
userId: member.userId,
userId: member.additionalDetails.AadObjectId,
});
}
});
Expand All @@ -106,7 +106,7 @@ async function loadContainer(config, swpId, entityInfo) {
for (const [userId, member] of members.entries()) {
const connections = member.connections;
if (connections.some((connection) => connection.id === targetConnectionId)) {
return { userId: userId, userName: member.userName };
return { userId: userId, userName: member.userName, aadObjectId: member.additionalDetails.AadObjectId };
}
}

Expand All @@ -132,9 +132,10 @@ async function loadContainer(config, swpId, entityInfo) {
);
});

// aadObjectId is the unique identifier for a user
await self.postMessage({
type: "client-data",
userId: user.userId,
userId: user.aadObjectId,
userName: user.userName,
containerId: swpId,
entityId: userEntityIdArray,
Expand Down

0 comments on commit ee47c63

Please sign in to comment.