Support PNI in QualifiedAddress.parse

This commit is contained in:
Fedor Indutny 2023-12-07 22:52:27 +01:00 committed by GitHub
parent 0b629c9f70
commit 7bad05f5a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 15 deletions

View file

@ -48,6 +48,7 @@ const {
describe('SignalProtocolStore', () => {
const ourAci = generateAci();
const ourPni = generatePni();
const theirAci = generateAci();
let store: SignalProtocolStore;
let identityKey: KeyPairType;
@ -1385,6 +1386,21 @@ describe('SignalProtocolStore', () => {
await store.archiveSiblingSessions(id.address, { zone });
});
it('should not throw in archiveSession on PNI', async () => {
const id = new QualifiedAddress(ourPni, new Address(theirAci, 1));
await store.storeSession(id, getSessionRecord(true));
await store.archiveSession(id);
const { devices, emptyServiceIds } = await store.getOpenDevices(ourPni, [
theirAci,
]);
assert.deepEqual(devices, []);
assert.deepEqual(emptyServiceIds, [theirAci]);
});
it('can be concurrently re-entered after waiting', async () => {
const a = new Zone('a');
const b = new Zone('b');