From 080361338ce63ae38f1c7e657386f0dce24f1ef2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 2 Apr 2026 01:23:18 +1300 Subject: [PATCH] (fix): replace deprecated Query::contains() with Query::containsAny() Query::contains() is deprecated for array attributes in the new query library. The deprecation warnings were spamming worker logs and potentially slowing attribute processing. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/Appwrite/Platform/Modules/Databases/Workers/Databases.php | 2 +- src/Appwrite/Platform/Modules/Teams/Http/Memberships/Delete.php | 2 +- src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php | 2 +- src/Appwrite/Platform/Workers/Functions.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php index 1744e68299..715a130eb7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php +++ b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php @@ -605,7 +605,7 @@ class Databases extends Action Query::equal('databaseInternalId', [$databaseInternalId]), Query::equal('type', [ColumnType::Relationship->value]), Query::notEqual('collectionInternalId', $collectionInternalId), - Query::contains('options', ['"relatedCollection":"'. $collectionId .'"']), + Query::containsAny('options', ['"relatedCollection":"'. $collectionId .'"']), ], $dbForProject, function ($attribute) use ($dbForProject, $databaseInternalId) { diff --git a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Delete.php b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Delete.php index 3b516c2d60..4e603f9baa 100644 --- a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Delete.php +++ b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Delete.php @@ -92,7 +92,7 @@ class Delete extends Action $ownersCount = $dbForProject->count( collection: 'memberships', queries: [ - Query::contains('roles', ['owner']), + Query::containsAny('roles', ['owner']), Query::equal('teamInternalId', [$team->getSequence()]) ], max: 2 diff --git a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php index 540dc8a871..83c805a4ea 100644 --- a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php +++ b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php @@ -92,7 +92,7 @@ class Update extends Action $ownersCount = $dbForProject->count( collection: 'memberships', queries: [ - Query::contains('roles', ['owner']), + Query::containsAny('roles', ['owner']), Query::equal('teamInternalId', [$team->getSequence()]) ], max: 2 diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index 3f19abdf22..a6dbd067d4 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -122,7 +122,7 @@ class Functions extends Action while ($sum >= $limit) { $functions = $dbForProject->find('functions', [ Query::select(['$id', 'events']), // Skip variables subqueries - Query::contains('events', $events), + Query::containsAny('events', $events), Query::limit($limit), Query::offset($offset), Query::orderAsc('$sequence'),