From fddac965be70b42bd06c66d3992406b83be75af1 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Thu, 27 Apr 2023 12:10:01 -0700 Subject: [PATCH] style(notifier): Sink all promises Refs #6000 --- packages/notifier/src/stored-notifier.js | 2 ++ packages/notifier/test/test-publish-kit.js | 30 +++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/notifier/src/stored-notifier.js b/packages/notifier/src/stored-notifier.js index 7f2303d75736..08ed9028c258 100644 --- a/packages/notifier/src/stored-notifier.js +++ b/packages/notifier/src/stored-notifier.js @@ -39,6 +39,8 @@ export const makeStoredNotifier = (notifier, storageNode, marshaller) => { fail(reason) { console.error('StoredNotifier failed to iterate', reason); }, + }).catch(reason => { + console.error('StoredNotifier halted iteration', reason); }); /** @type {Unserializer} */ diff --git a/packages/notifier/test/test-publish-kit.js b/packages/notifier/test/test-publish-kit.js index 4c66ae4463f1..709a4c1ded77 100644 --- a/packages/notifier/test/test-publish-kit.js +++ b/packages/notifier/test/test-publish-kit.js @@ -650,8 +650,12 @@ const verifySubscribeAfterSequencing = test.macro(async (t, makePublishKit) => { const sub2LIFO = []; const sub1FirstAll = []; - E.when(sub1.subscribeAfter(), cell => void sub1FirstAll.push(cell), t.fail); - E.when(sub1.subscribeAfter(), cell => void sub1FirstAll.push(cell), t.fail); + E.when(sub1.subscribeAfter(), cell => void sub1FirstAll.push(cell)).catch( + t.fail, + ); + E.when(sub1.subscribeAfter(), cell => void sub1FirstAll.push(cell)).catch( + t.fail, + ); pub2.publish(undefined); sub2LIFO.unshift(await sub2.subscribeAfter()); @@ -670,21 +674,18 @@ const verifySubscribeAfterSequencing = test.macro(async (t, makePublishKit) => { const sub1FirstLateAll = []; const sub1SecondAll = []; - E.when( + void E.when( sub1.subscribeAfter(), cell => void sub1FirstLateAll.push(cell), - t.fail, - ); - E.when( + ).catch(t.fail); + void E.when( sub1.subscribeAfter(0n), cell => void sub1FirstLateAll.push(cell), - t.fail, - ); - E.when( + ).catch(t.fail); + void E.when( sub1.subscribeAfter(sub1FirstAll[0].publishCount), cell => void sub1SecondAll.push(cell), - t.fail, - ); + ).catch(t.fail); pub2.publish(undefined); sub2LIFO.unshift(await sub2.subscribeAfter(sub2LIFO[0].publishCount)); @@ -709,13 +710,12 @@ const verifySubscribeAfterSequencing = test.macro(async (t, makePublishKit) => { const sub1SecondLateAll = []; const sub1FinalAll = []; for (const p of [sub1.subscribeAfter(), sub1.subscribeAfter(0n)]) { - E.when(p, cell => void sub1SecondLateAll.push(cell), t.fail); + E.when(p, cell => void sub1SecondLateAll.push(cell)).catch(t.fail); } - E.when( + void E.when( sub1.subscribeAfter(sub1SecondAll[0].publishCount), result => void sub1FinalAll.push(result), - t.fail, - ); + ).catch(t.fail); pub2.publish(undefined); sub2LIFO.unshift(await sub2.subscribeAfter(sub2LIFO[0].publishCount));