Skip to content

Commit

Permalink
fix: added test cases for send message and fixed bug in update group
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Nov 1, 2023
1 parent c89c961 commit 35998e2
Show file tree
Hide file tree
Showing 2 changed files with 527 additions and 166 deletions.
12 changes: 8 additions & 4 deletions packages/restapi/src/lib/chat/updateGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ export const updateGroupCore = async (
env,
});

const sameMembers = groupChat.members.every((element) =>
updatedParticipants.has(element.wallet.toLowerCase())
);
let sameMembers = true;

groupChat.members.map((element) => {
if (!updatedParticipants.has(element.wallet.toLowerCase())) {
sameMembers = false;
}
});

let sessionKey: string | null = null;
let encryptedSecret: string | null = null;
Expand All @@ -128,7 +132,7 @@ export const updateGroupCore = async (

const publicKeys: string[] = [];
// This will now only take keys of non-removed members
groupChat.members.every((element) => {
groupChat.members.map((element) => {
if (updatedParticipants.has(element.wallet.toLowerCase())) {
publicKeys.push(element.publicKey);
}
Expand Down
Loading

0 comments on commit 35998e2

Please sign in to comment.