Reset expire timer version after unlink
This commit is contained in:
parent
14d098f40f
commit
07a938ec98
5 changed files with 137 additions and 26 deletions
45
ts/test-electron/sql/removeAllConfiguration_test.ts
Normal file
45
ts/test-electron/sql/removeAllConfiguration_test.ts
Normal file
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import { DataWriter, DataReader } from '../../sql/Client';
|
||||
|
||||
describe('Remove all configuration test', () => {
|
||||
beforeEach(async () => {
|
||||
await DataWriter.removeAll();
|
||||
});
|
||||
it('Removes conversation-specific configuration', async () => {
|
||||
const { attributes } =
|
||||
await window.ConversationController.getOrCreateAndWait(
|
||||
generateGuid(),
|
||||
'private',
|
||||
{
|
||||
expireTimerVersion: 3,
|
||||
senderKeyInfo: {
|
||||
createdAtDate: Date.now(),
|
||||
distributionId: generateGuid(),
|
||||
memberDevices: [],
|
||||
},
|
||||
storageID: 'storageId',
|
||||
needsStorageServiceSync: true,
|
||||
storageUnknownFields: 'base64==',
|
||||
name: 'Name (and all other fields) should be preserved',
|
||||
}
|
||||
);
|
||||
|
||||
await DataWriter.removeAllConfiguration();
|
||||
|
||||
const convoAfter = await DataReader.getConversationById(attributes.id);
|
||||
assert.strictEqual(convoAfter?.expireTimerVersion, 1);
|
||||
assert.isUndefined(convoAfter?.storageID);
|
||||
assert.isUndefined(convoAfter?.needsStorageServiceSync);
|
||||
assert.isUndefined(convoAfter?.storageUnknownFields);
|
||||
assert.isUndefined(convoAfter?.senderKeyInfo);
|
||||
assert.strictEqual(
|
||||
convoAfter?.name,
|
||||
'Name (and all other fields) should be preserved'
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue