diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php index 52c6d2af16..e5cd732e17 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php @@ -142,18 +142,16 @@ class XList extends Action $hostname = $dbForProject->getAdapter()->getHostname(); $roles = $dbForProject->getAuthorization()->getRoles(); $collectionUpdatedAt = $collection->getAttribute('$updatedAt', ''); - $attributeCount = \count($collection->getAttribute('attributes', [])); - $indexCount = \count($collection->getAttribute('indexes', [])); + $schemaHash = \md5(\json_encode($collection->getAttribute('attributes', [])) . \json_encode($collection->getAttribute('indexes', []))); $cacheKeyBase = \sprintf( - '%s-cache-%s:%s:%s:collection:%s:%s:%d:%d:user:%s:%s', + '%s-cache-%s:%s:%s:collection:%s:%s:%s:user:%s:%s', $dbForProject->getCacheName(), $hostname ?? '', $dbForProject->getNamespace(), $dbForProject->getTenant(), $collectionId, $collectionUpdatedAt, - $attributeCount, - $indexCount, + $schemaHash, \md5(\json_encode($roles)), \md5(\json_encode($serializedQueries)) );