From b4432aab505b4fec87aa08458d66317ac394b69a Mon Sep 17 00:00:00 2001 From: Maciej Mensfeld Date: Tue, 27 Aug 2024 20:42:29 +0200 Subject: [PATCH] fix typo --- CHANGELOG.md | 1 + lib/karafka/web/tracking/consumers/listeners/errors.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fb38ee3..004581ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 0.10.2 (Unreleased) - [Fix] Prevent live-polling on elements wrapped in a button. +- [Fix] Fix errors extractor failure on first message-less tick / eofed ## 0.10.1 (2024-08-23) - **[Feature]** Support Recurring Tasks management (Pro). diff --git a/lib/karafka/web/tracking/consumers/listeners/errors.rb b/lib/karafka/web/tracking/consumers/listeners/errors.rb index e52ab944..2dd846f1 100644 --- a/lib/karafka/web/tracking/consumers/listeners/errors.rb +++ b/lib/karafka/web/tracking/consumers/listeners/errors.rb @@ -73,7 +73,9 @@ def extract_consumer_info(consumer) partition: consumer.partition, first_offset: consumer.messages.metadata.first_offset, last_offset: consumer.messages.metadata.last_offset, - committed_offset: consumer.coordinator.seek_offset - 1, + # We set it to -1000 if non-existent because after subtracting one, we will end up + # with -1001, which is "N/A" offset position for all the offsets here + committed_offset: (consumer.coordinator.seek_offset || -1_000) - 1, consumer: consumer.class.to_s, tags: consumer.tags }