Commit Graph
8322 Commits
Author SHA1 Message Date
Jake BarnbyandClaude Opus 4.5 ef46367fa3 Use Channel-based polling in all() implementation
Instead of relying on then() callbacks which may not fire correctly,
poll the adopted promise state directly using Swoole Coroutine::sleep
for proper yielding. Each promise is waited on in its own coroutine.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:21:07 +13:00
Jake BarnbyandClaude Opus 4.5 3078e6bff5 Run promise callbacks synchronously instead of in new coroutines
This avoids scheduling issues where spawned coroutines don't get a
chance to run before the main coroutine continues waiting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:06:34 +13:00
Jake BarnbyandClaude Opus 4.5 80643faacc Rewrite SwoolePromise with callback-based resolution
Replace busy-waiting in then() with proper callback queuing:
- Store waiting callbacks in array when promise is pending
- When promise resolves/rejects, process all waiting callbacks
- Run callbacks in coroutines for proper async execution
- This eliminates deadlocks from busy-wait polling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:35:49 +13:00
Jake BarnbyandClaude Opus 4.5 cd75f17815 Add public resolve/reject to Promise and fix all() implementation
- Add public resolve() and reject() methods to Promise class
- Create combined promise without executor (no coroutine spawned)
- Use direct resolve/reject calls instead of captured callbacks
- This ensures the promise can be settled regardless of coroutine timing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 20:56:28 +13:00
Jake BarnbyandClaude Opus 4.5 7b9970af9c Rewrite all() to match SyncPromiseAdapter pattern
Use callback-based approach similar to graphql-php's SyncPromiseAdapter:
- Create a combined promise and capture resolve/reject callbacks
- Register then() callbacks on each input promise
- Resolve when all callbacks have fired

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 20:35:33 +13:00
Jake BarnbyandClaude Opus 4.5 2544baa669 Fix batch promises with coroutine-based synchronization
- Use Swoole Coroutine::sleep for proper coroutine yielding instead of
  callback-based completion tracking
- Spawn a coroutine for each promise to wait for its completion
- Use Channel for synchronization between coroutines
- Add public accessors to Promise class for state checking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 20:10:07 +13:00
Jake BarnbyandClaude Opus 4.5 4d6a3d36f7 Fix batch promise handling with callback-based completion tracking
Use callback-based counting instead of channel synchronization to track
promise completion. Work directly with GQLPromise objects and use their
then() method which properly chains through the adapter to the underlying
SwoolePromise.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:46:36 +13:00
Jake BarnbyandClaude Opus 4.5 ab936a7ce4 Simplify Swoole adapter all() by delegating to SwoolePromise::all
Instead of reimplementing the promise aggregation logic, extract adopted
promises from GQLPromise wrappers and delegate to SwoolePromise::all()
which already handles the coroutine synchronization properly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:17:32 +13:00
Jake BarnbyandClaude Opus 4.5 b671bfb1c7 Fix Swoole adapter all() to work directly with GQLPromise objects
Instead of extracting adopted promises and delegating to SwoolePromise::all(),
implement the batch handling logic directly to properly work with GQLPromise
wrappers. Uses Swoole Channel for synchronization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:55:20 +13:00
Jake BarnbyandClaude Opus 4.5 a70d67810e Fix Promise::all() to handle mixed values and promises
The graphql-php executor passes both promises and plain values to
the PromiseAdapter::all() method. Updated SwoolePromise::all() to
properly handle plain values by storing them directly without
attempting to call ->then() on them.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:36:40 +13:00
Jake Barnby 762be367e1 Fix collision 2026-01-21 18:09:03 +13:00
Jake Barnby f3b2562add Flag dirty across workers 2026-01-21 17:22:33 +13:00
Jake Barnby 0d26a2a2dd Merge remote-tracking branch 'origin/1.8.x' into feat-dynamic-graphql
# Conflicts:
#	app/init/resources.php
#	composer.lock
2026-01-21 14:02:19 +13:00
Jake Barnby 124ee0df8f Remove redundant type locking 2026-01-21 13:59:52 +13:00
Jake Barnby 802379366a Fix project/collection schema sanitization 2026-01-21 13:59:40 +13:00
Jake Barnby 9b8dcfda07 Fix custom scalar 2026-01-21 13:59:24 +13:00
Jake Barnby e9698c96f0 Allow dynamic types 2026-01-21 01:32:34 +13:00
shimon 0203323b4a Remove 'authorization' injection from Bulk Delete, Update, and Upsert classes 2026-01-18 14:01:35 +02:00
shimon c3ea66b37a Merge branch '1.8.x' of github.com:appwrite/appwrite into add-webhooks-and-functions-events
# Conflicts:
#	app/controllers/shared/api.php
#	app/init/resources.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Update.php
2026-01-18 11:01:40 +02:00
Damodar LohaniandGitHub 72ce068714 Merge pull request #11057 from appwrite/feat-health-module
Feat: Health module
2026-01-18 07:27:19 +05:45
Chirag AggarwalandGitHub ea76213dd2 Merge pull request #11146 from appwrite/feat-cleanup-stale-executions 2026-01-17 12:44:15 +05:30
Matej BačoandGitHub 12b79363d1 Merge pull request #11148 from appwrite/feat-new-schema-dualwriting
Feat: Support dual-writing for new schema features
2026-01-16 15:38:23 +01:00
Jake BarnbyandGitHub 0723101397 Merge pull request #11005 from appwrite/dat-969 2026-01-17 03:31:50 +13:00
Matej BačoandGitHub d56a3c1534 Apply suggestion from @Meldiron 2026-01-16 14:53:05 +01:00
ArnabChatterjee20k b1fab79dc4 updated query logic in array to be of and format 2026-01-16 19:06:55 +05:30
Darshan 2f066a6ba8 add: check. 2026-01-16 18:41:22 +05:30
Darshan e8ca0610ee fix: type 2026-01-16 18:40:37 +05:30
Darshan 15caa27977 lint. 2026-01-16 18:38:40 +05:30
Darshan 5f22022527 fix: async being missed. 2026-01-16 18:33:27 +05:30
ArnabChatterjee20k b9c7c172ad updated query conversion for nested query 2026-01-16 18:18:24 +05:30
Matej Bačo c2bf1e8040 Merge branch '1.8.x' into feat-new-schema-dualwriting 2026-01-16 13:24:02 +01:00
Matej Bačo cda03f63ab Support dual-writing for new schema features 2026-01-16 13:23:46 +01:00
Chirag Aggarwal f5a61fb4d6 feat: add cleanup for stale function executions
Adds a new interval task that marks executions stuck in 'processing'
status for more than 30 minutes as 'failed' with a timeout error.
2026-01-16 17:21:05 +05:30
ArnabChatterjee20k da871635d9 Fix namespace import for RuntimeQuery class and update test file accordingly 2026-01-16 16:16:03 +05:30
Darshan ccaea5d010 add: constant. 2026-01-16 16:11:38 +05:30
Darshan b5e9c1786a fix: maintenance logic. 2026-01-16 16:04:54 +05:30
Darshan beee5e721e upate: run on maintenance as well. 2026-01-16 15:55:45 +05:30
Darshan 0ef4bf21cc address comments. 2026-01-16 15:48:21 +05:30
ArnabChatterjee20k b2486fcb6c Merge remote-tracking branch 'upstream/1.8.x' into dat-969 2026-01-16 15:47:25 +05:30
Darshan c67b77bca0 update: implement proper logs cleanup! 2026-01-16 15:06:35 +05:30
Damodar Lohani fbf390c710 Merge remote-tracking branch 'origin/1.8.x' into feat-health-module 2026-01-15 13:55:09 +00:00
Damodar Lohani 991f5ff9fd Catch exception 2026-01-15 13:19:34 +00:00
Damodar Lohani e8d8373922 Fix: phone auth limit 2026-01-15 12:59:30 +00:00
DarshanandGitHub 42a1c8da38 Merge branch '1.8.x' into fix-specs-descriptions 2026-01-15 12:05:19 +05:30
Darshan 75696a21bf update: remove excluded keys from descriptions. 2026-01-15 11:56:19 +05:30
Chirag AggarwalandGitHub 629479d275 Merge branch '1.8.x' into release-cli-13.0.0.rc3 2026-01-15 10:59:11 +05:30
Jake Barnby 7ab3debb10 Format 2026-01-15 16:37:09 +13:00
Jake Barnby c083e1ce74 Throw AppwriteException so handler can unwrap 2026-01-15 16:31:37 +13:00
Chirag Aggarwal f78d5523ce mMerge branch '1.8.x' into release-cli-13.0.0.rc3 2026-01-14 21:34:40 +05:30
Jake Barnby 09a337aa1b Fix validators 2026-01-15 04:10:57 +13:00