Support for single-attachment delete synced across devices

This commit is contained in:
Scott Nonnenberg 2024-06-21 15:35:18 -07:00 committed by GitHub
parent 97229e2e65
commit ac04d02d4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 422 additions and 55 deletions

View file

@ -84,6 +84,7 @@ describe('backup/attachments', () => {
return {
cdnKey: `cdnKey${index}`,
cdnNumber: 3,
clientUuid: generateGuid(),
key: getBase64(`key${index}`),
digest: getBase64(`digest${index}`),
iv: getBase64(`iv${index}`),
@ -212,7 +213,7 @@ describe('backup/attachments', () => {
describe('Preview attachments', () => {
it('BackupLevel.Messages, roundtrips preview attachments', async () => {
const attachment = composeAttachment(1);
const attachment = composeAttachment(1, { clientUuid: undefined });
await asymmetricRoundtripHarness(
[
@ -236,7 +237,7 @@ describe('backup/attachments', () => {
);
});
it('BackupLevel.Media, roundtrips preview attachments', async () => {
const attachment = composeAttachment(1);
const attachment = composeAttachment(1, { clientUuid: undefined });
strictAssert(attachment.digest, 'digest exists');
await asymmetricRoundtripHarness(
@ -283,7 +284,7 @@ describe('backup/attachments', () => {
describe('contact attachments', () => {
it('BackupLevel.Messages, roundtrips contact attachments', async () => {
const attachment = composeAttachment(1);
const attachment = composeAttachment(1, { clientUuid: undefined });
await asymmetricRoundtripHarness(
[
@ -308,7 +309,7 @@ describe('backup/attachments', () => {
);
});
it('BackupLevel.Media, roundtrips contact attachments', async () => {
const attachment = composeAttachment(1);
const attachment = composeAttachment(1, { clientUuid: undefined });
strictAssert(attachment.digest, 'digest exists');
await asymmetricRoundtripHarness(
@ -346,7 +347,7 @@ describe('backup/attachments', () => {
describe('quotes', () => {
it('BackupLevel.Messages, roundtrips quote attachments', async () => {
const attachment = composeAttachment(1);
const attachment = composeAttachment(1, { clientUuid: undefined });
const authorAci = generateAci();
const quotedMessage: QuotedMessageType = {
authorAci,
@ -383,7 +384,7 @@ describe('backup/attachments', () => {
);
});
it('BackupLevel.Media, roundtrips quote attachments', async () => {
const attachment = composeAttachment(1);
const attachment = composeAttachment(1, { clientUuid: undefined });
strictAssert(attachment.digest, 'digest exists');
const authorAci = generateAci();
const quotedMessage: QuotedMessageType = {
@ -435,7 +436,7 @@ describe('backup/attachments', () => {
attachments: [existingAttachment],
});
const quoteAttachment = composeAttachment(2);
const quoteAttachment = composeAttachment(2, { clientUuid: undefined });
delete quoteAttachment.thumbnail;
strictAssert(quoteAttachment.digest, 'digest exists');
@ -687,7 +688,7 @@ describe('backup/attachments', () => {
});
describe('when this device sent sticker (i.e. encryption info exists on message)', () => {
it('roundtrips sticker', async () => {
const attachment = composeAttachment(1);
const attachment = composeAttachment(1, { clientUuid: undefined });
strictAssert(attachment.digest, 'digest exists');
await asymmetricRoundtripHarness(
[