From 7b688055ceb332a68df060c54ca8cc39f6b65625 Mon Sep 17 00:00:00 2001 From: bever1337 Date: Tue, 17 Oct 2023 17:17:07 -0400 Subject: [PATCH] Listener awaits with all --- packages/toolkit/src/listenerMiddleware/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/toolkit/src/listenerMiddleware/index.ts b/packages/toolkit/src/listenerMiddleware/index.ts index f502fa99bc..df8191ff4d 100644 --- a/packages/toolkit/src/listenerMiddleware/index.ts +++ b/packages/toolkit/src/listenerMiddleware/index.ts @@ -30,6 +30,7 @@ import { addAbortSignalListener, assertFunction, catchRejection, + noop, } from './utils' import { listenerCancelled, @@ -113,7 +114,7 @@ const createFork = ( ) if (opts?.autoJoin) { - parentBlockingPromises.push(result) + parentBlockingPromises.push(result.catch(noop)) } return { @@ -439,7 +440,7 @@ export function createListenerMiddleware< }) } } finally { - await Promise.allSettled(autoJoinPromises) + await Promise.all(autoJoinPromises) abortControllerWithReason(internalTaskController, listenerCompleted) // Notify that the task has completed entry.pending.delete(internalTaskController)