From 80e50fb09d2db102972caf1ada7dcba187e93f02 Mon Sep 17 00:00:00 2001 From: Bernhard Geisberger Date: Mon, 30 May 2022 16:26:59 +0200 Subject: [PATCH] fix SeekOffsets data structure --- src/consumer/seekOffsets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/consumer/seekOffsets.js b/src/consumer/seekOffsets.js index aa444e42e..8d0fdd750 100644 --- a/src/consumer/seekOffsets.js +++ b/src/consumer/seekOffsets.js @@ -1,6 +1,6 @@ module.exports = class SeekOffsets extends Map { getKey(topic, partition) { - return JSON.stringify(topic, partition) + return JSON.stringify([topic, partition]) } set(topic, partition, offset) { @@ -14,7 +14,7 @@ module.exports = class SeekOffsets extends Map { } pop(topic, partition) { - if (this.size === 0) { + if (this.size === 0 || !this.has(topic, partition)) { return }