From 2e30e5c578073e00a90edf482d9236742f212184 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Mon, 15 Apr 2024 10:32:25 +0000 Subject: [PATCH] fix: MemoryFifo return null when empty and timeout 0 --- yarn-project/foundation/src/fifo/memory_fifo.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yarn-project/foundation/src/fifo/memory_fifo.ts b/yarn-project/foundation/src/fifo/memory_fifo.ts index bcd0145fb58..18c9ee05b40 100644 --- a/yarn-project/foundation/src/fifo/memory_fifo.ts +++ b/yarn-project/foundation/src/fifo/memory_fifo.ts @@ -39,6 +39,10 @@ export class MemoryFifo { return Promise.resolve(null); } + if (timeout === 0) { + return Promise.resolve(null); + } + return new Promise((resolve, reject) => { this.waiting.push(resolve);