fix: override local 03 group priority with what we get from merge

pull/3281/head
Audric Ackermann 11 months ago
parent b7cd4fc247
commit 82ec3414b5
No known key found for this signature in database

@ -725,7 +725,8 @@ async function handleSingleGroupUpdate({
);
}
if (!ConvoHub.use().get(groupPk)) {
const convoExisting = ConvoHub.use().get(groupPk);
if (!convoExisting) {
const created = await ConvoHub.use().getOrCreateAndWait(groupPk, ConversationTypeEnum.GROUPV2);
const joinedAt =
groupInWrapper.joinedAtSeconds * 1000 || CONVERSATION.LAST_JOINED_FALLBACK_TIMESTAMP;
@ -743,6 +744,12 @@ async function handleSingleGroupUpdate({
});
await created.commit();
getSwarmPollingInstance().addGroupId(PubKey.cast(groupPk));
} else {
// Note: the priority is the only **field** we want to sync from our user group wrapper for 03-groups
const changes = await convoExisting.setPriorityFromWrapper(groupInWrapper.priority, false);
if (changes) {
await convoExisting.commit();
}
}
}

Loading…
Cancel
Save