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

(cherry picked from commit f70f60bf66)
This commit is contained in:
Johannes Meyer 2026-01-21 12:27:53 +01:00
parent 0589146756
commit 2963fd60b8

View file

@ -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) {