Backup import/export consistency fixes

This commit is contained in:
Fedor Indutny
2024-09-16 14:30:39 -07:00
committed by GitHub
parent fd408c52cf
commit 8dabe4fbe4
9 changed files with 195 additions and 62 deletions

View File

@@ -34,6 +34,7 @@ const EXPIRATION_TIMER_FLAG = Proto.DataMessage.Flags.EXPIRATION_TIMER_UPDATE;
const CONTACT_A = generateAci();
const CONTACT_A_PNI = generatePni();
const CONTACT_A_E164 = '+121355501234';
const CONTACT_B = generateAci();
const CONTACT_C = generateAci();
const ADMIN_A = generateAci();
@@ -72,6 +73,10 @@ function createMessage(
seenStatus: SeenStatus.Seen,
type: 'group-v2-change',
sourceServiceId,
source:
sourceServiceId === CONTACT_A || sourceServiceId === CONTACT_A_PNI
? CONTACT_A_E164
: undefined,
};
}
@@ -86,7 +91,12 @@ describe('backup/groupv2/notifications', () => {
await window.ConversationController.getOrCreateAndWait(
CONTACT_A,
'private',
{ pni: CONTACT_A_PNI, systemGivenName: 'CONTACT_A', active_at: 1 }
{
pni: CONTACT_A_PNI,
e164: CONTACT_A_E164,
systemGivenName: 'CONTACT_A',
active_at: 1,
}
);
await window.ConversationController.getOrCreateAndWait(
CONTACT_B,
@@ -2044,6 +2054,7 @@ describe('backup/groupv2/notifications', () => {
readStatus: ReadStatus.Read,
seenStatus: SeenStatus.Seen,
sourceServiceId: CONTACT_A,
source: CONTACT_A_E164,
};
counter += 1;
@@ -2062,6 +2073,7 @@ describe('backup/groupv2/notifications', () => {
readStatus: ReadStatus.Read,
seenStatus: SeenStatus.Seen,
sourceServiceId: CONTACT_A,
source: CONTACT_A_E164,
};
const messages: Array<MessageAttributesType> = [
@@ -2085,6 +2097,7 @@ describe('backup/groupv2/notifications', () => {
sourceServiceId: CONTACT_A,
},
sourceServiceId: CONTACT_A,
source: CONTACT_A_E164,
flags: EXPIRATION_TIMER_FLAG,
type: 'timer-notification' as const,
received_at: counter,