From 4bf5a24efbc2d482f7a8384bebb948572c3d7a08 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 20 Nov 2020 11:50:45 -0800 Subject: [PATCH] Migration: Ensure that groupId lookup is kept up to date --- ts/groups.ts | 2 +- ts/models/conversations.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/groups.ts b/ts/groups.ts index ecf65cbb3f..4124a0cb64 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -904,7 +904,7 @@ export async function initiateMigrationToGroupV2( `initiateMigrationToGroupV2/${logId}: After members migration, we are not a member!` ); } - if (!areWeInvited) { + if (areWeInvited) { throw new Error( `initiateMigrationToGroupV2/${logId}: After members migration, we are invited!` ); diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index 79a9039ec8..d8714db007 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -4332,7 +4332,7 @@ window.Whisper.ConversationCollection = window.Backbone.Collection.extend({ delete this._byUuid[oldValue]; } if (idProp === 'groupId') { - delete this._byGroupid[oldValue]; + delete this._byGroupId[oldValue]; } } if (model.get('e164')) { @@ -4342,7 +4342,7 @@ window.Whisper.ConversationCollection = window.Backbone.Collection.extend({ this._byUuid[model.get('uuid')] = model; } if (model.get('groupId')) { - this._byGroupid[model.get('groupId')] = model; + this._byGroupId[model.get('groupId')] = model; } } );