From f27d729ac84e3ae56701f8ec914b46f7682a98af Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 1 Sep 2026 16:19:44 +0200 Subject: [PATCH] fix: Rewind iterator before calling current/next Signed-off-by: Carl Schwan --- lib/Controller/LogController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Controller/LogController.php b/lib/Controller/LogController.php index 018e9358..ce0ca1ea 100644 --- a/lib/Controller/LogController.php +++ b/lib/Controller/LogController.php @@ -71,6 +71,7 @@ public function get($query = '', $count = 50, $offset = 0): JSONResponse { */ private function getLastItem() { $iterator = $this->logIteratorFactory->getLogIterator($this->settingsService->getShownLevels()); + $iterator->rewind(); return $iterator->current(); } @@ -102,6 +103,7 @@ public function poll(string $lastReqId): JSONResponse { } $iterator = $this->logIteratorFactory->getLogIterator($this->settingsService->getShownLevels()); + $iterator->rewind(); $iterator->next(); $data = [];