diff --git a/.gitmodules b/.gitmodules index 065fe76c46..e9d2cb296f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "app/console"] path = app/console url = https://github.com/appwrite/console - branch = 4.3.23 + branch = 4.3.27 diff --git a/app/console b/app/console index 112fccf5a0..e0828010f4 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 112fccf5a044c9795b31b264f5974224a3545a17 +Subproject commit e0828010f4c222bb99cf65ddfed288e60602666f diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index a4ef8c2a4c..7a47649ae6 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -669,6 +669,7 @@ App::post('/v1/teams/:teamId/memberships') } $queueForEvents + ->setParam('userId', $invitee->getId()) ->setParam('teamId', $team->getId()) ->setParam('membershipId', $membership->getId()) ; @@ -902,6 +903,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') $dbForProject->purgeCachedDocument('users', $profile->getId()); $queueForEvents + ->setParam('userId', $profile->getId()) ->setParam('teamId', $team->getId()) ->setParam('membershipId', $membership->getId()); @@ -1027,6 +1029,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') Authorization::skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1)); $queueForEvents + ->setParam('userId', $user->getId()) ->setParam('teamId', $team->getId()) ->setParam('membershipId', $membership->getId()) ; @@ -1108,6 +1111,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') } $queueForEvents + ->setParam('userId', $user->getId()) ->setParam('teamId', $team->getId()) ->setParam('membershipId', $membership->getId()) ->setPayload($response->output($membership, Response::MODEL_MEMBERSHIP)) diff --git a/app/init.php b/app/init.php index 73d1b5f153..bef85ff1cc 100644 --- a/app/init.php +++ b/app/init.php @@ -112,7 +112,7 @@ const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours -const APP_CACHE_BUSTER = 4323; +const APP_CACHE_BUSTER = 4327; const APP_VERSION_STABLE = '1.5.8'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; diff --git a/app/realtime.php b/app/realtime.php index 28e6c1691f..9c3c2b4d6a 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -380,8 +380,10 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, $user = $database->getDocument('users', $userId); $roles = Auth::getRoles($user); + $channels = $realtime->connections[$connection]['channels']; - $realtime->subscribe($projectId, $connection, $roles, $realtime->connections[$connection]['channels']); + $realtime->unsubscribe($connection); + $realtime->subscribe($projectId, $connection, $roles, $channels); $register->get('pools')->reclaim(); } diff --git a/composer.json b/composer.json index 1df0147088..b89ae6b259 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.8.*", - "utopia-php/vcs": "0.6.*", + "utopia-php/vcs": "0.8.*", "utopia-php/websocket": "0.1.*", "matomo/device-detector": "6.1.*", "dragonmantank/cron-expression": "3.3.2", diff --git a/composer.lock b/composer.lock index b893d35ed9..3abb14ee2e 100644 --- a/composer.lock +++ b/composer.lock @@ -2758,16 +2758,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.6.7", + "version": "0.8.1", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974" + "reference": "3084aa93d24ed1e70f01e75f4318fc0d07f12596" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974", - "reference": "8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/3084aa93d24ed1e70f01e75f4318fc0d07f12596", + "reference": "3084aa93d24ed1e70f01e75f4318fc0d07f12596", "shasum": "" }, "require": { @@ -2801,9 +2801,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.6.7" + "source": "https://github.com/utopia-php/vcs/tree/0.8.1" }, - "time": "2024-06-05T17:38:29+00:00" + "time": "2024-07-29T20:49:09+00:00" }, { "name": "utopia-php/websocket", diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index 1f2886713f..1e1486b9df 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -217,7 +217,15 @@ class Builds extends Action $branchName = $deployment->getAttribute('providerBranch'); $commitHash = $deployment->getAttribute('providerCommitHash', ''); - $gitCloneCommand = $github->generateCloneCommand($cloneOwner, $cloneRepository, $branchName, $tmpDirectory, $rootDirectory, $commitHash); + + $cloneVersion = $branchName; + $cloneType = GitHub::CLONE_TYPE_BRANCH; + if(!empty($commitHash)) { + $cloneVersion = $commitHash; + $cloneType = GitHub::CLONE_TYPE_COMMIT; + } + + $gitCloneCommand = $github->generateCloneCommand($cloneOwner, $cloneRepository, $cloneVersion, $cloneType, $tmpDirectory, $rootDirectory); $stdout = ''; $stderr = ''; Console::execute('mkdir -p /tmp/builds/' . \escapeshellcmd($buildId), '', $stdout, $stderr); @@ -240,7 +248,13 @@ class Builds extends Action if (!empty($templateRepositoryName) && !empty($templateOwnerName) && !empty($templateBranch)) { // Clone template repo $tmpTemplateDirectory = '/tmp/builds/' . \escapeshellcmd($buildId) . '/template'; - $gitCloneCommandForTemplate = $github->generateCloneCommand($templateOwnerName, $templateRepositoryName, $templateBranch, $tmpTemplateDirectory, $templateRootDirectory); + + $cloneType = GitHub::CLONE_TYPE_BRANCH; + if(\str_starts_with($templateBranch, '0.1.')) { // Temporary fix for 1.5. In future versions this only support tag names + $cloneType = GitHub::CLONE_TYPE_TAG; + } + + $gitCloneCommandForTemplate = $github->generateCloneCommand($templateOwnerName, $templateRepositoryName, $templateBranch, $cloneType, $tmpTemplateDirectory, $templateRootDirectory); $exit = Console::execute($gitCloneCommandForTemplate, '', $stdout, $stderr); if ($exit !== 0) {