diff --git a/ts/ConversationController.ts b/ts/ConversationController.ts index 7db94a23e..cf842c23c 100644 --- a/ts/ConversationController.ts +++ b/ts/ConversationController.ts @@ -781,7 +781,11 @@ export class ConversationController { `ConversationController: Removing ${temporaryConversations.length} temporary conversations` ); } - const queue = new PQueue({ concurrency: 3, timeout: 1000 * 60 * 2 }); + const queue = new PQueue({ + concurrency: 3, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); queue.addAll( temporaryConversations.map(item => async () => { await removeConversation(item.id, { diff --git a/ts/SignalProtocolStore.ts b/ts/SignalProtocolStore.ts index d63b67f82..4feb05fda 100644 --- a/ts/SignalProtocolStore.ts +++ b/ts/SignalProtocolStore.ts @@ -516,7 +516,11 @@ export class SignalProtocolStore extends EventsMixin { } private _createSenderKeyQueue(): PQueue { - return new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2 }); + return new PQueue({ + concurrency: 1, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); } private _getSenderKeyQueue(senderId: QualifiedAddress): PQueue { @@ -663,7 +667,11 @@ export class SignalProtocolStore extends EventsMixin { } private _createSessionQueue(): PQueue { - return new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2 }); + return new PQueue({ + concurrency: 1, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); } private _getSessionQueue(id: QualifiedAddress): PQueue { diff --git a/ts/components/emoji/lib.ts b/ts/components/emoji/lib.ts index 6d9198cf0..49f8a64f6 100644 --- a/ts/components/emoji/lib.ts +++ b/ts/components/emoji/lib.ts @@ -100,7 +100,11 @@ const makeImagePath = (src: string) => { return `${ROOT_PATH}node_modules/emoji-datasource-apple/img/apple/64/${src}`; }; -const imageQueue = new PQueue({ concurrency: 10, timeout: 1000 * 60 * 2 }); +const imageQueue = new PQueue({ + concurrency: 10, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, +}); const images = new Set(); export const preloadImages = async (): Promise => { diff --git a/ts/routineProfileRefresh.ts b/ts/routineProfileRefresh.ts index 2ca2553dd..0f454a2a1 100644 --- a/ts/routineProfileRefresh.ts +++ b/ts/routineProfileRefresh.ts @@ -75,7 +75,11 @@ export async function routineProfileRefresh({ } } - const refreshQueue = new PQueue({ concurrency: 5, timeout: 1000 * 60 * 2 }); + const refreshQueue = new PQueue({ + concurrency: 5, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); for (const conversation of conversationsToRefresh) { refreshQueue.add(() => refreshConversation(conversation)); } diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index c87929237..2ac3311f1 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -200,17 +200,27 @@ export default class MessageReceiver } this.serverTrustRoot = Bytes.fromBase64(serverTrustRoot); - this.incomingQueue = new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2 }); - this.appQueue = new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2 }); + this.incomingQueue = new PQueue({ + concurrency: 1, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); + this.appQueue = new PQueue({ + concurrency: 1, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); // All envelopes start in encryptedQueue and progress to decryptedQueue this.encryptedQueue = new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2, + throwOnTimeout: true, }); this.decryptedQueue = new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2, + throwOnTimeout: true, }); this.decryptAndCacheBatcher = createBatcher({ diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index 71bebf2fb..0bf8c80a4 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -2015,7 +2015,11 @@ export function initialize({ }); // Upload stickers - const queue = new PQueue({ concurrency: 3, timeout: 1000 * 60 * 2 }); + const queue = new PQueue({ + concurrency: 3, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); await Promise.all( stickers.map(async (sticker: ServerAttachmentType, index: number) => { const stickerParams = makePutParams( diff --git a/ts/util/batcher.ts b/ts/util/batcher.ts index acd8054db..07c75b486 100644 --- a/ts/util/batcher.ts +++ b/ts/util/batcher.ts @@ -44,7 +44,11 @@ export function createBatcher( let batcher: BatcherType; let timeout: NodeJS.Timeout | null; let items: Array = []; - const queue = new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2 }); + const queue = new PQueue({ + concurrency: 1, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); function _kickBatchOff() { if (timeout) { diff --git a/ts/util/callingTones.ts b/ts/util/callingTones.ts index 719d415b8..7942a2fce 100644 --- a/ts/util/callingTones.ts +++ b/ts/util/callingTones.ts @@ -7,6 +7,7 @@ import { Sound } from './Sound'; const ringtoneEventQueue = new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2, + throwOnTimeout: true, }); class CallingTones { diff --git a/ts/util/sendToGroup.ts b/ts/util/sendToGroup.ts index f6ef1151b..5da692444 100644 --- a/ts/util/sendToGroup.ts +++ b/ts/util/sendToGroup.ts @@ -649,6 +649,7 @@ export async function _waitForAll({ const queue = new PQueue({ concurrency: maxConcurrency, timeout: 2 * 60 * 1000, + throwOnTimeout: true, }); return queue.addAll(tasks); } diff --git a/ts/util/waitBatcher.ts b/ts/util/waitBatcher.ts index 8b7b7ffd5..fcb3c5333 100644 --- a/ts/util/waitBatcher.ts +++ b/ts/util/waitBatcher.ts @@ -62,7 +62,11 @@ export function createWaitBatcher( let waitBatcher: BatcherType; let timeout: NodeJS.Timeout | null; let items: Array> = []; - const queue = new PQueue({ concurrency: 1, timeout: 1000 * 60 * 2 }); + const queue = new PQueue({ + concurrency: 1, + timeout: 1000 * 60 * 2, + throwOnTimeout: true, + }); async function _kickBatchOff() { const itemsRef = items;