From 6a316b23b5da70a7fc2b02c4d5dfadb559d978a3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 24 Apr 2026 17:57:44 +0200 Subject: [PATCH 1/2] fix: chunk storage ids when preload storage info Signed-off-by: Robin Appelman --- lib/private/Files/Cache/StorageGlobal.php | 30 ++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/private/Files/Cache/StorageGlobal.php b/lib/private/Files/Cache/StorageGlobal.php index 8835dbf9f8c15..53a40c034cede 100644 --- a/lib/private/Files/Cache/StorageGlobal.php +++ b/lib/private/Files/Cache/StorageGlobal.php @@ -42,21 +42,23 @@ public function loadForStorageIds(array $storageIds): void { $builder = $this->connection->getQueryBuilder(); $query = $builder->select(['id', 'numeric_id', 'available', 'last_checked']) ->from('storages') - ->where($builder->expr()->in('id', $builder->createNamedParameter(array_values($storageIds), IQueryBuilder::PARAM_STR_ARRAY))); - - $result = $query->executeQuery(); - while (($row = $result->fetch()) !== false) { - $normalizedRow = [ - 'id' => (string)$row['id'], - 'numeric_id' => (int)$row['numeric_id'], - 'available' => (bool)$row['available'], - 'last_checked' => (int)$row['last_checked'], - ]; - - $this->cache[$normalizedRow['id']] = $normalizedRow; - } + ->where($builder->expr()->in('id', $builder->createParameter('ids'), IQueryBuilder::PARAM_STR_ARRAY)); + + foreach (array_chunk($storageIds, 1000) as $chunk) { + $query->setParameter('ids', $chunk, IQueryBuilder::PARAM_STR_ARRAY); - $result->closeCursor(); + $result = $query->executeQuery(); + while (($row = $result->fetch()) !== false) { + $normalizedRow = [ + 'id' => (string)$row['id'], + 'numeric_id' => (int)$row['numeric_id'], + 'available' => (bool)$row['available'], + 'last_checked' => (int)$row['last_checked'], + ]; + + $this->cache[$normalizedRow['id']] = $normalizedRow; + } + } } /** From 5c1a72a969491b358ec4bb2011de08cf8c6d15dc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 1 May 2026 17:25:35 +0200 Subject: [PATCH 2/2] chore: psalm fixes Signed-off-by: Robin Appelman --- apps/dav/lib/Migration/Version1039Date20260408000000.php | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/dav/lib/Migration/Version1039Date20260408000000.php b/apps/dav/lib/Migration/Version1039Date20260408000000.php index e10f20d764ae6..e3dbca8f65217 100644 --- a/apps/dav/lib/Migration/Version1039Date20260408000000.php +++ b/apps/dav/lib/Migration/Version1039Date20260408000000.php @@ -22,6 +22,7 @@ #[AddColumn(table: 'calendars', name: 'default_alarm_pday', type: ColumnType::INTEGER)] #[AddColumn(table: 'calendars', name: 'default_alarm_fday', type: ColumnType::INTEGER)] class Version1039Date20260408000000 extends SimpleMigrationStep { + #[\Override] public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure();