diff --git a/src/Utils/event-buffer.ts b/src/Utils/event-buffer.ts index 71c9385..a6e6176 100644 --- a/src/Utils/event-buffer.ts +++ b/src/Utils/event-buffer.ts @@ -162,6 +162,12 @@ export const makeEventBuffer = (logger: Logger): BaileysBufferableEventEmitter = }, processInBuffer(task) { if(isBuffering) { + // if flushing right now, + // adding this won't make a difference + if(waitingForPreBufferEnd) { + return + } + preBufferTask = Promise.allSettled([ preBufferTask, task ]) preBufferTraces.push(new Error('').stack!) }