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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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,

View file

@ -67,14 +67,12 @@ describe('backup/non-bubble messages', () => {
id: generateGuid(),
type: 'incoming',
received_at: 1,
received_at_ms: 1,
sent_at: 1,
timestamp: 1,
sourceServiceId: CONTACT_A,
sourceDevice: 1,
readStatus: ReadStatus.Unread,
seenStatus: SeenStatus.Unseen,
unidentifiedDeliveryReceived: true,
readStatus: ReadStatus.Read,
seenStatus: SeenStatus.Seen,
flags: Proto.DataMessage.Flags.END_SESSION,
},
]);
@ -525,14 +523,12 @@ describe('backup/non-bubble messages', () => {
id: generateGuid(),
type: 'incoming',
received_at: 1,
received_at_ms: 1,
sourceServiceId: CONTACT_A,
sourceDevice: 1,
sent_at: 1,
timestamp: 1,
readStatus: ReadStatus.Read,
seenStatus: SeenStatus.Seen,
unidentifiedDeliveryReceived: true,
supportedVersionAtReceive: 5,
requiredProtocolVersion: 6,
},