From 3ce82ab29f93eac35619adca2b18c6bd1f6d401b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 31 Mar 2026 18:35:45 +1300 Subject: [PATCH] (fix): update utopia-php/database with Pool write hook propagation fix The Pool adapter was only syncing write hooks (Permissions, Tenancy) for plural document operations (createDocuments, updateDocuments) but not singular ones (createDocument, updateDocument). This caused permission rows to never be inserted for single-document creates, making newly created users invisible to subsequent queries on SQL databases. Also removes stale PHPStan baseline entries and fixes redundant null coalesce in FunctionCache. Co-Authored-By: Claude Opus 4.6 (1M context) --- composer.lock | 8 ++++---- phpstan-baseline.neon | 12 ------------ src/Appwrite/Utopia/Database/Hooks/FunctionCache.php | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/composer.lock b/composer.lock index 57d5442ce2..b1fcd05449 100644 --- a/composer.lock +++ b/composer.lock @@ -4038,12 +4038,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "ec959e33d8f5f74f760ecfdbc16b7f3f9391aaa4" + "reference": "146221ac1fc1c6b3ccc1372762d2791d94323989" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/ec959e33d8f5f74f760ecfdbc16b7f3f9391aaa4", - "reference": "ec959e33d8f5f74f760ecfdbc16b7f3f9391aaa4", + "url": "https://api.github.com/repos/utopia-php/database/zipball/146221ac1fc1c6b3ccc1372762d2791d94323989", + "reference": "146221ac1fc1c6b3ccc1372762d2791d94323989", "shasum": "" }, "require": { @@ -4091,7 +4091,7 @@ "issues": "https://github.com/utopia-php/database/issues", "source": "https://github.com/utopia-php/database/tree/feat-query-lib" }, - "time": "2026-03-27T01:59:39+00:00" + "time": "2026-03-31T05:07:20+00:00" }, { "name": "utopia-php/detector", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 37e2579644..8ff11372f4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -156,12 +156,6 @@ parameters: count: 1 path: app/init/registers.php - - - message: '#^Variable \$hostname on left side of \?\? always exists and is not nullable\.$#' - identifier: nullCoalesce.variable - count: 1 - path: app/init/resources.php - - message: '#^Anonymous function has an unused use \$register\.$#' identifier: closure.unusedUse @@ -492,12 +486,6 @@ parameters: count: 1 path: src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php - - - message: '#^Variable \$relations in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php - - message: '#^Anonymous function has an unused use \$dbForProject\.$#' identifier: closure.unusedUse diff --git a/src/Appwrite/Utopia/Database/Hooks/FunctionCache.php b/src/Appwrite/Utopia/Database/Hooks/FunctionCache.php index 65b36e5fa4..8de6be02ee 100644 --- a/src/Appwrite/Utopia/Database/Hooks/FunctionCache.php +++ b/src/Appwrite/Utopia/Database/Hooks/FunctionCache.php @@ -38,7 +38,7 @@ class FunctionCache implements Lifecycle $cacheKey = \sprintf( '%s-cache-%s:%s:%s:project:%s:functions:events', $this->database->getCacheName(), - $hostname ?? '', + $hostname, $this->database->getNamespace(), $this->database->getTenant(), $this->project->getId()