Improve check during message export
This commit is contained in:
parent
a769429b36
commit
11fed7e7f8
2 changed files with 58 additions and 2 deletions
|
@ -15,6 +15,7 @@ import { ReadStatus } from '../../messages/MessageReadStatus';
|
|||
import { SeenStatus } from '../../MessageSeenStatus';
|
||||
import { loadCallsHistory } from '../../services/callHistoryLoader';
|
||||
import { ID_V1_LENGTH } from '../../groups';
|
||||
import { DurationInSeconds, WEEK } from '../../util/durations';
|
||||
import {
|
||||
setupBasics,
|
||||
asymmetricRoundtripHarness,
|
||||
|
@ -423,4 +424,49 @@ describe('backup/bubble messages', () => {
|
|||
[]
|
||||
);
|
||||
});
|
||||
|
||||
it('drops messages that expire soon', async () => {
|
||||
await asymmetricRoundtripHarness(
|
||||
[
|
||||
{
|
||||
conversationId: contactA.id,
|
||||
id: generateGuid(),
|
||||
type: 'incoming',
|
||||
received_at: 3,
|
||||
received_at_ms: 3,
|
||||
sent_at: 3,
|
||||
timestamp: 3,
|
||||
sourceServiceId: CONTACT_A,
|
||||
body: 'd',
|
||||
readStatus: ReadStatus.Unread,
|
||||
seenStatus: SeenStatus.Unseen,
|
||||
unidentifiedDeliveryReceived: true,
|
||||
expirationStartTimestamp: Date.now(),
|
||||
expireTimer: DurationInSeconds.fromSeconds(1),
|
||||
},
|
||||
],
|
||||
[]
|
||||
);
|
||||
});
|
||||
|
||||
it('does not drop messages that expire far in the future', async () => {
|
||||
await symmetricRoundtripHarness([
|
||||
{
|
||||
conversationId: contactA.id,
|
||||
id: generateGuid(),
|
||||
type: 'incoming',
|
||||
received_at: 3,
|
||||
received_at_ms: 3,
|
||||
sent_at: 3,
|
||||
timestamp: 3,
|
||||
sourceServiceId: CONTACT_A,
|
||||
body: 'd',
|
||||
readStatus: ReadStatus.Unread,
|
||||
seenStatus: SeenStatus.Unseen,
|
||||
unidentifiedDeliveryReceived: true,
|
||||
expirationStartTimestamp: Date.now(),
|
||||
expireTimer: DurationInSeconds.fromMillis(WEEK),
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue