fix: do not add to pre-buffer if waiting for end

This commit is contained in:
Adhiraj Singh
2022-11-26 00:37:38 +05:30
parent bcf33d786c
commit a589e88136

View File

@@ -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!)
}