From a6013c2aeed8516b068de70815375801749ca4da 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 bcd0145fb58b..18c9ee05b40b 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);