Commit graph

706 commits

Author SHA1 Message Date
Damodar Lohani
30a511692b test: add unit coverage for Request::getHeader non-string coercion
Refs CLO-4280
2026-04-28 04:15:00 +00:00
Chirag Aggarwal
da4dcd8505
Merge branch '1.9.x' into chore/phpstan-level-4 2026-04-21 17:08:46 +05:30
ArnabChatterjee20k
78eeac6d14 Add unsubscribe functionality and enhance subscription handling in Realtime tests 2026-04-20 17:38:01 +05:30
Chirag Aggarwal
d2230f8fe7 chore: bump PHPStan to level 4 and fix all new errors
Raises `phpstan.neon` level from 3 to 4 and fixes the 549 new errors
that level 4 surfaces across 157 files. Fixes are root-cause — no
`@phpstan-ignore`, no `@var` casts, no baseline entries, no widened
types. A handful of latent bugs were fixed along the way:

- `app/controllers/general.php`: path-traversal guard was negating
  `\substr(...)` before the strict comparison (`!\substr(...) === $base`
  was always `false === $base`). Rewritten as `\substr(...) !== $base`.
- `src/Appwrite/Platform/Modules/Databases/Http/Databases/Logs/XList.php`
  and `.../TablesDB/Logs/XList.php`: were importing the raw Matomo
  `DeviceDetector` (whose `getDevice()` returns `?int`) but treating the
  result as an array with `deviceName/deviceBrand/deviceModel` keys.
  Swapped to `Appwrite\Detector\Detector`, matching the wrapper already
  used a few lines below for `$os`/`$client`.
- `src/Appwrite/Platform/Modules/Functions/Workers/Builds.php`: a match
  key was checking `$resourceKey === 'functions'` when `$resourceKey`
  is `'functionId'|'siteId'` — always false. Switched to the intended
  `$resource->getCollection() === 'functions'` check.
- `src/Appwrite/OpenSSL/OpenSSL.php`: `encrypt()` return type tightened
  to `string|false` to match `openssl_encrypt`; this lets callers'
  `=== false` error handling remain meaningful.
- `app/controllers/api/messaging.php`: removed a dead
  `array_key_exists('from', [])` branch in the Msg91 provider (empty
  array literal; branch was unreachable).

Large cleanup categories across the 549 fixes:
- Removed redundant `?? default` on array offsets and expressions that
  PHPStan now knows are non-nullable.
- Removed unreachable statements (mostly `return;` after `throw` or
  `markTestSkipped()`).
- Removed redundant `is_array`/`is_string`/`is_bool`/`instanceof` checks
  on already-narrowed types.
- Added `default =>` arms (or throwing arms) to non-exhaustive matches
  on `string`/`mixed` input.
- Removed dead `$document === false` branches where method return types
  were tightened to non-nullable `Document`.
- Removed unused properties (`$version` on Etsy/Zoom OAuth2, `$paths` on
  Installer State, `$source` on MigrationsWorker, `$account2` on two
  GraphQL auth tests), unused traits (`ApiVectorsDB`, `DatabaseFixture`),
  and an unused `cleanupStaleExecutions` task method.
- Replaced `assertTrue(true)` and redundant `assertIsArray`/`assertIsString`/
  `assertNotNull` assertions with `addToAssertionCount(1)` or
  `assertNotEmpty` where the runtime type was already known.
2026-04-19 17:31:20 +05:30
ArnabChatterjee20k
6ba810a4da fix unit tests 2026-04-15 17:49:33 +05:30
ArnabChatterjee20k
6d9b787816 updated string replacement 2026-04-15 17:38:21 +05:30
ArnabChatterjee20k
7b8fb409b1 added database filtering 2026-04-15 17:33:57 +05:30
ArnabChatterjee20k
1fb78115e8 added backward compat 2026-04-15 17:23:18 +05:30
Chirag Aggarwal
efadf17bfe Fix GraphQL 15 static analysis 2026-04-14 10:26:59 +05:30
Chirag Aggarwal
a6af609317 Remove scopes spec override, now fixed at source in #11839 2026-04-13 10:33:46 +05:30
Chirag Aggarwal
035f6244e1 Revert "fix: require scopes for project keys"
This reverts commit 8deafcaf4d52a59cc2e1b27c7a128e8b7843afa4.
2026-04-13 10:33:46 +05:30
Chirag Aggarwal
723cb1a488 fix: require scopes for project keys 2026-04-13 10:33:46 +05:30
Chirag Aggarwal
815209ebb0 fix: address sdk spec review feedback 2026-04-13 10:33:46 +05:30
Chirag Aggarwal
53c74582fc refactor: simplify request parameter spec overrides 2026-04-13 10:33:46 +05:30
Chirag Aggarwal
78bbe77580 fix: align project sdk spec generation 2026-04-13 10:33:45 +05:30
Chirag Aggarwal
be56317bf2
Merge branch '1.9.x' into feat/migrate-di-container 2026-04-06 12:13:31 +05:30
Chirag Aggarwal
b8eb0810c2 Make response sensitive mode instance-scoped 2026-04-06 10:24:32 +05:30
Chirag Aggarwal
cb74a5756a Remove request and response static state 2026-04-06 10:20:18 +05:30
Chirag Aggarwal
4a905a6ac9 Merge branch '1.9.x' into feat/migrate-di-container
Resolve conflicts keeping DI container migration (container->set pattern)
while incorporating 1.9.x fixes: PHPStan unused variable cleanup in
GraphQL Resolvers, (int) casts in Builds.php, and phpstan-baseline removal.
2026-04-02 11:17:32 +05:30
Chirag Aggarwal
77b4f8b7a0 style: apply formatter 2026-04-02 08:23:51 +05:30
Chirag Aggarwal
33f8e35b62 chore: remove phpstan baseline 2026-04-01 23:01:11 +05:30
Chirag Aggarwal
a76a03d988
Merge branch '1.9.x' into feat/migrate-di-container 2026-04-01 14:22:13 +05:30
Chirag Aggarwal
908e408480 Merge remote-tracking branch 'origin/1.9.x' into feat/migrate-di-container
# Conflicts:
#	app/init/resources.php
#	composer.json
#	composer.lock
#	phpstan-baseline.neon
2026-04-01 11:46:13 +05:30
Chirag Aggarwal
f2ea0b9b48 Fix PHPStan baseline cleanup issues (part 2) 2026-04-01 10:20:20 +05:30
Chirag Aggarwal
18ed6a9c59 Fix more PHPStan static access issues 2026-03-31 22:04:37 +05:30
Jake Barnby
b47ac00ca8 (refactor): rename migrate param and add --migrate flag to upgrade task 2026-03-31 21:08:29 +13:00
Jake Barnby
2f53d09c5b (feat): add database migration step to upgrade installer 2026-03-31 20:58:33 +13:00
Chirag Aggarwal
10ebf942b1
Merge branch '1.9.x' into feat/migrate-di-container 2026-03-28 20:36:08 +05:30
Claude
7aff75ae1c
refactor: convert User::isApp() and User::isPrivileged() from static to instance methods
All call sites now use $user->isApp() and $user->isPrivileged() instance
syntax instead of static User::isApp() / $user::isPrivileged() calls.
Added setUser() to Request class for consistency with Response.

https://claude.ai/code/session_01JLPDurUgyj7qViA8JqQFTH
2026-03-26 02:47:56 +00:00
Chirag Aggarwal
4970d1b6f2
Merge branch '1.9.x' into feat/migrate-di-container 2026-03-24 18:15:45 +05:30
Jake Barnby
76684874e9 (feat): installer improvements — reset, state resilience, container progress, SSL email fallback 2026-03-24 21:25:57 +13:00
Jake Barnby
a1441174f2 fix: update installer module test to expect 7 actions including CertificateGet 2026-03-24 17:57:58 +13:00
Chirag Aggarwal
89db65299d Merge remote-tracking branch 'origin/1.9.x' into feat/migrate-di-container 2026-03-24 10:15:38 +05:30
Chirag Aggarwal
ea6a05be4f fix analyze 2026-03-24 07:51:23 +05:30
ArnabChatterjee20k
8ae07ac61f Merge remote-tracking branch 'origin/1.9.x' into revert-11585-revert-11402-sync-mongodb 2026-03-23 10:47:23 +05:30
Matej Bačo
0a5a8c5b6c Merge branch '1.8.x' into 1.9.x 2026-03-20 16:28:16 +01:00
Matej Bačo
875637bf35
Merge pull request #11533 from appwrite/feat-user-impersonation
Add impersonation feature for user management
2026-03-20 16:13:51 +01:00
ArnabChatterjee20k
9a70445395 Merge remote-tracking branch 'origin/1.9.x' into revert-11585-revert-11402-sync-mongodb 2026-03-20 11:29:37 +05:30
Jake Barnby
91e252382b (test): add strict type assertions and list coverage for V21 $sequence filter 2026-03-20 17:33:15 +13:00
Jake Barnby
827dd2d039 fix: preserve integer type for $sequence and handle nested relationship casting
- Document/Row model filters now preserve int type for $sequence instead of always casting to string
- V21 response filter recursively casts $sequence on nested relationship documents
- Added unit tests for nested document/row $sequence casting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 16:36:04 +13:00
Jake Barnby
c155c88a31 Fix stan 2026-03-20 15:37:23 +13:00
Jake Barnby
2007fbf241 Merge remote-tracking branch 'origin/1.8.x' into chore-update
# Conflicts:
#	app/init/constants.php
#	composer.json
#	composer.lock
#	src/Appwrite/Migration/Migration.php
2026-03-20 14:04:46 +13:00
Jake Barnby
9235a4cc15 test: add V21 request and response filter unit tests 2026-03-20 13:08:27 +13:00
eldadfux
e8c0ab0cc1 Fixed email validator 2026-03-19 22:44:04 +01:00
copilot-swe-agent[bot]
b79132556c feat: add support for tauri://localhost as an allowed origin
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
2026-03-19 20:14:24 +00:00
ArnabChatterjee20k
c7907932e4
Revert "Revert "Documentsdb + vectordb (latest)"" 2026-03-19 20:30:42 +05:30
ArnabChatterjee20k
9917f95dfd
Revert "Documentsdb + vectordb (latest)" 2026-03-19 19:18:27 +05:30
Jake Barnby
b8cb146eb9
Merge pull request #11402 from appwrite/sync-mongodb 2026-03-19 12:30:05 +00:00
ArnabChatterjee20k
331fb7f689 fixed php stan issue 2026-03-19 17:10:45 +05:30
ArnabChatterjee20k
feddd77066 fixed analyze 2026-03-19 17:02:27 +05:30