Compare commits

..
Author SHA1 Message Date
Chirag Aggarwal 86526fa1df chore: update changelog 2025-05-22 06:11:28 +00:00
Chirag Aggarwal c5f7a72409 chore: update flutter_web_auth_2 docs to match 4.x 2025-05-22 06:03:35 +00:00
Matej BačoandGitHub 6b7071ca94 Merge pull request #9852 from appwrite/fix-double-logs
Fix: double logs on failure
2025-05-21 16:59:24 +02:00
Matej Bačo 83e62dc6e1 Fix double logs on failure 2025-05-21 16:44:04 +02:00
8 changed files with 49 additions and 22 deletions
+2 -1
View File
@@ -284,5 +284,6 @@ $cli
$cli->shutdown()->action(fn () => Timer::clearAll());
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
// Enable coroutines, but disable TCP hooks. These don't work until we use `\Utopia\Cache\Adapter\Pool` and `\Utopia\Database\Adapter\Pool`.
Runtime::enableCoroutine(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP);
run($cli->run(...));
Generated
+6 -6
View File
@@ -4816,16 +4816,16 @@
"packages-dev": [
{
"name": "appwrite/sdk-generator",
"version": "0.40.18",
"version": "0.40.17",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "38de4b9c58112d7e83eb75955994c8412a401093"
"reference": "7e333c1003bfd4763e4d6f3a0a799fde5e7bc4de"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/38de4b9c58112d7e83eb75955994c8412a401093",
"reference": "38de4b9c58112d7e83eb75955994c8412a401093",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/7e333c1003bfd4763e4d6f3a0a799fde5e7bc4de",
"reference": "7e333c1003bfd4763e4d6f3a0a799fde5e7bc4de",
"shasum": ""
},
"require": {
@@ -4861,9 +4861,9 @@
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"support": {
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/0.40.18"
"source": "https://github.com/appwrite/sdk-generator/tree/0.40.17"
},
"time": "2025-05-21T14:14:47+00:00"
"time": "2025-05-16T15:10:54+00:00"
},
{
"name": "doctrine/annotations",
+6 -1
View File
@@ -1,6 +1,11 @@
# Change Log
## 16.0.1
## 16.1.1
* Update `flutter_web_auth_2` dependency to version 4.1.0
* Update `auth.html` example in README.md to align with `flutter_web_auth_2` documentation
## 16.1.0
* Add `setDevKey` method to Client service
* Add `upsertDocument` method to Databases service
+18 -6
View File
@@ -56,13 +56,25 @@ For web in order to capture the OAuth2 callback URL and send it to the applicati
```html
<!DOCTYPE html>
<title>Authentication complete</title>
<p>Authentication is complete. If this does not happen automatically, please
close the window.
<p>Authentication is complete. If this does not happen automatically, please close the window.</p>
<script>
window.opener.postMessage({
'flutter-web-auth-2': window.location.href
}, window.location.origin);
window.close();
function postAuthenticationMessage() {
const message = {
'flutter-web-auth-2': window.location.href
};
if (window.opener) {
window.opener.postMessage(message, window.location.origin);
window.close();
} else if (window.parent && window.parent !== window) {
window.parent.postMessage(message, window.location.origin);
} else {
localStorage.setItem('flutter-web-auth-2', window.location.href);
window.close();
}
}
postAuthenticationMessage();
</script>
```
@@ -1218,13 +1218,22 @@ class Builds extends Action
$message .= "\n" . $error;
}
// Combine with previous logs if deployment got past build process
$previousLogs = '';
if (!empty($deployment->getAttribute('buildEndedAt', ''))) {
$previousLogs = $deployment->getAttribute('buildLogs', '');
if (!empty($previousLogs)) {
$message = $previousLogs . "\n" . $message;
}
}
$endTime = DateTime::now();
$durationEnd = \microtime(true);
$deployment->setAttribute('buildEndedAt', $endTime);
$deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart)));
$deployment->setAttribute('status', 'failed');
$deployment->setAttribute('buildLogs', $deployment->getAttribute('buildLogs', '') . "\n" . $message);
$deployment->setAttribute('buildLogs', $message);
$deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment);
if ($deployment->getInternalId() === $resource->getAttribute('latestDeploymentInternalId', '')) {
+5 -5
View File
@@ -79,16 +79,16 @@ abstract class ScheduleBase extends Action
// start with "0" to load all active documents.
$lastSyncUpdate = "0";
$this->collectSchedules($dbForPlatform, $getProjectDB, $lastSyncUpdate);
$this->collectSchedules($pools, $dbForPlatform, $getProjectDB, $lastSyncUpdate);
Console::success("Starting timers at " . DateTime::now());
/**
* The timer synchronize $schedules copy with database collection.
*/
Timer::tick(static::UPDATE_TIMER * 1000, function () use ($dbForPlatform, $getProjectDB, &$lastSyncUpdate) {
Timer::tick(static::UPDATE_TIMER * 1000, function () use ($pools, $dbForPlatform, $getProjectDB, &$lastSyncUpdate) {
$time = DateTime::now();
Console::log("Sync tick: Running at $time");
$this->collectSchedules($dbForPlatform, $getProjectDB, $lastSyncUpdate);
$this->collectSchedules($pools, $dbForPlatform, $getProjectDB, $lastSyncUpdate);
});
while (true) {
@@ -103,7 +103,7 @@ abstract class ScheduleBase extends Action
}
}
private function collectSchedules(Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void
private function collectSchedules(Group $pools, Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void
{
// If we haven't synced yet, load all active schedules
$initialLoad = $lastSyncUpdate === "0";
@@ -115,7 +115,7 @@ abstract class ScheduleBase extends Action
* @throws Exception
* @var Document $schedule
*/
$getSchedule = function (Document $schedule) use ($dbForPlatform, $getProjectDB): array {
$getSchedule = function (Document $schedule) use ($pools, $dbForPlatform, $getProjectDB): array {
$project = $dbForPlatform->getDocument('projects', $schedule->getAttribute('projectId'));
$resource = $getProjectDB($project)->getDocument(
@@ -76,7 +76,7 @@ class ScheduleFunctions extends ScheduleBase
}
foreach ($delayedExecutions as $delay => $schedules) {
\go(function () use ($delay, $schedules, $dbForPlatform) {
\go(function () use ($delay, $schedules, $pools, $dbForPlatform) {
\sleep($delay); // in seconds
foreach ($schedules as $delayConfig) {
@@ -40,7 +40,7 @@ class ScheduleMessages extends ScheduleBase
continue;
}
\go(function () use ($schedule, $scheduledAt, $dbForPlatform) {
\go(function () use ($schedule, $scheduledAt, $pools, $dbForPlatform) {
$queueForMessaging = new Messaging($this->publisher);
$this->updateProjectAccess($schedule['project'], $dbForPlatform);