Removed hard limit on unprocessed messages in cache
This commit is contained in:
parent
1381e8df5d
commit
e51f582bfb
6 changed files with 130 additions and 44 deletions
|
@ -1273,7 +1273,10 @@ describe('SignalProtocolStore', () => {
|
|||
assert.equal(await store.getSenderKey(id, distributionId), testSenderKey);
|
||||
|
||||
const allUnprocessed =
|
||||
await store.getAllUnprocessedAndIncrementAttempts();
|
||||
await store.getUnprocessedByIdsAndIncrementAttempts(
|
||||
await store.getAllUnprocessedIds()
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
allUnprocessed.map(({ envelope }) => envelope),
|
||||
['second']
|
||||
|
@ -1327,7 +1330,12 @@ describe('SignalProtocolStore', () => {
|
|||
|
||||
assert.equal(await store.loadSession(id), testSession);
|
||||
assert.equal(await store.getSenderKey(id, distributionId), testSenderKey);
|
||||
assert.deepEqual(await store.getAllUnprocessedAndIncrementAttempts(), []);
|
||||
assert.deepEqual(
|
||||
await store.getUnprocessedByIdsAndIncrementAttempts(
|
||||
await store.getAllUnprocessedIds()
|
||||
),
|
||||
[]
|
||||
);
|
||||
});
|
||||
|
||||
it('can be re-entered', async () => {
|
||||
|
@ -1423,7 +1431,9 @@ describe('SignalProtocolStore', () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
await store.removeAllUnprocessed();
|
||||
const items = await store.getAllUnprocessedAndIncrementAttempts();
|
||||
const items = await store.getUnprocessedByIdsAndIncrementAttempts(
|
||||
await store.getAllUnprocessedIds()
|
||||
);
|
||||
assert.strictEqual(items.length, 0);
|
||||
});
|
||||
|
||||
|
@ -1471,7 +1481,9 @@ describe('SignalProtocolStore', () => {
|
|||
}),
|
||||
]);
|
||||
|
||||
const items = await store.getAllUnprocessedAndIncrementAttempts();
|
||||
const items = await store.getUnprocessedByIdsAndIncrementAttempts(
|
||||
await store.getAllUnprocessedIds()
|
||||
);
|
||||
assert.strictEqual(items.length, 3);
|
||||
|
||||
// they are in the proper order because the collection comparator is
|
||||
|
@ -1495,7 +1507,9 @@ describe('SignalProtocolStore', () => {
|
|||
});
|
||||
await store.updateUnprocessedWithData(id, { decrypted: 'updated' });
|
||||
|
||||
const items = await store.getAllUnprocessedAndIncrementAttempts();
|
||||
const items = await store.getUnprocessedByIdsAndIncrementAttempts(
|
||||
await store.getAllUnprocessedIds()
|
||||
);
|
||||
assert.strictEqual(items.length, 1);
|
||||
assert.strictEqual(items[0].decrypted, 'updated');
|
||||
assert.strictEqual(items[0].timestamp, NOW + 1);
|
||||
|
@ -1517,7 +1531,9 @@ describe('SignalProtocolStore', () => {
|
|||
});
|
||||
await store.removeUnprocessed(id);
|
||||
|
||||
const items = await store.getAllUnprocessedAndIncrementAttempts();
|
||||
const items = await store.getUnprocessedByIdsAndIncrementAttempts(
|
||||
await store.getAllUnprocessedIds()
|
||||
);
|
||||
assert.strictEqual(items.length, 0);
|
||||
});
|
||||
|
||||
|
@ -1533,7 +1549,9 @@ describe('SignalProtocolStore', () => {
|
|||
urgent: true,
|
||||
});
|
||||
|
||||
const items = await store.getAllUnprocessedAndIncrementAttempts();
|
||||
const items = await store.getUnprocessedByIdsAndIncrementAttempts(
|
||||
await store.getAllUnprocessedIds()
|
||||
);
|
||||
assert.strictEqual(items.length, 0);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue