From f70f60bf660665025f66b95cfca25a86b79929ff Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 21 Jan 2026 12:27:53 +0100 Subject: [PATCH] VolatileStateResults: Fetch individual redis results for the actual current item Previously, only the second and other subsequent item was updated with redis results. Not sure why this wasn't discovered until recently, as the issue was already part of the initial fix meant for a very similar issue, affecting *all* items. Hell, maybe because my initial analysis this time also led me into the wrong direction, so when reviewing this, proper testing and result verification is key! fixes #1318 --- library/Icingadb/Redis/VolatileStateResults.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/library/Icingadb/Redis/VolatileStateResults.php b/library/Icingadb/Redis/VolatileStateResults.php index 5c1994e4..4776e14c 100644 --- a/library/Icingadb/Redis/VolatileStateResults.php +++ b/library/Icingadb/Redis/VolatileStateResults.php @@ -84,6 +84,10 @@ class VolatileStateResults extends ResultSet } $result = parent::current(); + if ($this->isCacheDisabled && ! $this->redisUnavailable) { + $this->applyRedisUpdates([$result]); + } + if (! $this->includeModelID) { unset($result['id']); } @@ -91,15 +95,6 @@ class VolatileStateResults extends ResultSet return $result; } - public function next(): void - { - parent::next(); - - if (! $this->redisUnavailable && $this->isCacheDisabled && $this->valid()) { - $this->applyRedisUpdates([parent::current()]); - } - } - public function key(): int { if (! $this->redisUnavailable && ! $this->updatesApplied && ! $this->isCacheDisabled) {