From 4912e5a6da52d07fdbf03708ae10d49af1ab0407 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 18 Oct 2022 16:42:45 -0700 Subject: [PATCH] Fix PNI merging for PNI-only conversations --- ts/ConversationController.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ts/ConversationController.ts b/ts/ConversationController.ts index a33f2fcc2d..4f86e5ec6a 100644 --- a/ts/ConversationController.ts +++ b/ts/ConversationController.ts @@ -720,6 +720,13 @@ export class ConversationController { const existing = byUuid[pni]; if (!existing) { 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 { log.warn(`checkForConflicts: Found conflict with pni ${pni}`);