Fix PNI merging for PNI-only conversations

This commit is contained in:
Fedor Indutny 2022-10-18 16:42:45 -07:00 committed by GitHub
parent 03f158a1a7
commit 4912e5a6da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -720,6 +720,13 @@ export class ConversationController {
const existing = byUuid[pni]; const existing = byUuid[pni];
if (!existing) { if (!existing) {
byUuid[pni] = conversation; byUuid[pni] = conversation;
} else if (existing === conversation) {
// Conversation has both uuid and pni set to the same value. This
// happens when starting a conversation by E164.
assertDev(
pni === uuid,
'checkForConflicts: expected PNI to be equal to UUID'
);
} else { } else {
log.warn(`checkForConflicts: Found conflict with pni ${pni}`); log.warn(`checkForConflicts: Found conflict with pni ${pni}`);