Revert "Process read syncs after batches of messages"
This reverts commit eccace481b
.
This commit is contained in:
parent
6637fc2b95
commit
c5de4c6284
1 changed files with 23 additions and 44 deletions
|
@ -311,12 +311,6 @@ export async function startApp(): Promise<void> {
|
||||||
window.Signal.Services.lightSessionResetQueue = lightSessionResetQueue;
|
window.Signal.Services.lightSessionResetQueue = lightSessionResetQueue;
|
||||||
lightSessionResetQueue.pause();
|
lightSessionResetQueue.pause();
|
||||||
|
|
||||||
const readSyncQueue = new window.PQueue({
|
|
||||||
concurrency: 1,
|
|
||||||
timeout: 1000 * 60 * 2,
|
|
||||||
});
|
|
||||||
readSyncQueue.pause();
|
|
||||||
|
|
||||||
window.Whisper.deliveryReceiptQueue = new window.PQueue({
|
window.Whisper.deliveryReceiptQueue = new window.PQueue({
|
||||||
concurrency: 1,
|
concurrency: 1,
|
||||||
timeout: 1000 * 60 * 2,
|
timeout: 1000 * 60 * 2,
|
||||||
|
@ -2484,8 +2478,6 @@ export async function startApp(): Promise<void> {
|
||||||
window.waitForEmptyEventQueue = waitForEmptyEventQueue;
|
window.waitForEmptyEventQueue = waitForEmptyEventQueue;
|
||||||
|
|
||||||
async function onEmpty() {
|
async function onEmpty() {
|
||||||
window.Signal.Util.setBatchingStrategy(false);
|
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
window.waitForAllBatchers(),
|
window.waitForAllBatchers(),
|
||||||
window.flushAllWaitBatchers(),
|
window.flushAllWaitBatchers(),
|
||||||
|
@ -2504,7 +2496,6 @@ export async function startApp(): Promise<void> {
|
||||||
|
|
||||||
profileKeyResponseQueue.start();
|
profileKeyResponseQueue.start();
|
||||||
lightSessionResetQueue.start();
|
lightSessionResetQueue.start();
|
||||||
readSyncQueue.start();
|
|
||||||
window.Whisper.deliveryReceiptQueue.start();
|
window.Whisper.deliveryReceiptQueue.start();
|
||||||
window.Whisper.Notifications.enable();
|
window.Whisper.Notifications.enable();
|
||||||
|
|
||||||
|
@ -2522,6 +2513,8 @@ export async function startApp(): Promise<void> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.Signal.Util.setBatchingStrategy(false);
|
||||||
|
|
||||||
const attachmentDownloadQueue = window.attachmentDownloadQueue || [];
|
const attachmentDownloadQueue = window.attachmentDownloadQueue || [];
|
||||||
|
|
||||||
// NOTE: ts/models/messages.ts expects this global to become undefined
|
// NOTE: ts/models/messages.ts expects this global to become undefined
|
||||||
|
@ -3785,43 +3778,29 @@ export async function startApp(): Promise<void> {
|
||||||
uuid: senderUuid,
|
uuid: senderUuid,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (readSyncQueue.isPaused) {
|
window.log.info(
|
||||||
window.log.info(
|
'read sync',
|
||||||
'delaying processing of read sync',
|
sender,
|
||||||
sender,
|
senderUuid,
|
||||||
senderUuid,
|
envelopeTimestamp,
|
||||||
envelopeTimestamp,
|
senderId,
|
||||||
senderId,
|
'for message',
|
||||||
'for message',
|
timestamp
|
||||||
timestamp
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
readSyncQueue.add(() => {
|
const receipt = ReadSyncs.getSingleton().add({
|
||||||
window.log.info(
|
senderId,
|
||||||
'read sync',
|
sender,
|
||||||
sender,
|
senderUuid,
|
||||||
senderUuid,
|
timestamp,
|
||||||
envelopeTimestamp,
|
readAt,
|
||||||
senderId,
|
|
||||||
'for message',
|
|
||||||
timestamp
|
|
||||||
);
|
|
||||||
|
|
||||||
const receipt = ReadSyncs.getSingleton().add({
|
|
||||||
senderId,
|
|
||||||
sender,
|
|
||||||
senderUuid,
|
|
||||||
timestamp,
|
|
||||||
readAt,
|
|
||||||
});
|
|
||||||
|
|
||||||
receipt.on('remove', ev.confirm);
|
|
||||||
|
|
||||||
// Note: Here we wait, because we want read states to be in the database
|
|
||||||
// before we move on.
|
|
||||||
return ReadSyncs.getSingleton().onSync(receipt);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
receipt.on('remove', ev.confirm);
|
||||||
|
|
||||||
|
// Note: Here we wait, because we want read states to be in the database
|
||||||
|
// before we move on.
|
||||||
|
return ReadSyncs.getSingleton().onSync(receipt);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onVerified(ev: VerifiedEvent) {
|
async function onVerified(ev: VerifiedEvent) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue