The early-return branches added in #12138 for already-complete chunked
uploads bypass the trailing $queueForEvents->setParam('bucketId', ...)
calls. The action returns cleanly, the shutdown hook then calls
Event::generateEvents with empty params, throws \InvalidArgumentException,
and the error handler maps it to HTTP 500.
Reset the queue on each early-return path so the shutdown short-circuits
on the empty event string -- the resource was created on a previous
request and that request already fired the event; replaying it would
double-trigger webhooks/functions.
Applied to Storage Files Create, Functions Deployments Create, and
Sites Deployments Create -- all three endpoints share the same pattern
introduced by #12138.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Renames the actor identity constants used by the audit/auth flow:
- ACTIVITY_TYPE_USER -> ACTOR_TYPE_USER ('user')
- ACTIVITY_TYPE_ADMIN -> ACTOR_TYPE_ADMIN ('admin')
- ACTIVITY_TYPE_GUEST -> ACTOR_TYPE_GUEST ('guest')
- ACTIVITY_TYPE_KEY_PROJECT -> ACTOR_TYPE_KEY_PROJECT ('keyProject')
- ACTIVITY_TYPE_KEY_ACCOUNT -> ACTOR_TYPE_KEY_ACCOUNT ('keyAccount')
- ACTIVITY_TYPE_KEY_ORGANIZATION -> ACTOR_TYPE_KEY_ORGANIZATION ('keyOrganization')
Values are unchanged. Call sites updated in:
- app/controllers/shared/api.php
- src/Appwrite/Platform/Workers/Audits.php
Audit payload key rename (userType -> actorType) and utopia-php/audit
bump will land in a follow-up PR.
BREAKING CHANGE: ACTIVITY_TYPE_* global constants are removed. Any
downstream extension or plugin importing those names must be updated
to the ACTOR_TYPE_* equivalents.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The SMTP test email uses email-base-styled.tpl as its base template,
which contains {{platform}}, {{logoUrl}}, {{accentColor}}, and social/
legal link placeholders. These were never passed as template variables,
causing them to render as literal strings (e.g. "{{platform}} logo").
Inject the platform config and pass the variables to MailMessage,
matching the pattern used by OTP and magic-url email flows.
Co-Authored-By: Harsh Mahajan <harsh@appwrite.io>
These fields were already persisted on update but omitted from the response
model, causing them to disappear after a page refresh in the console.
Co-Authored-By: Harsh Mahajan <harsh@appwrite.io>
Drops the redundant Route::resolveParams() call. The matched path
params are now provided directly via the new frame-local 'params'
injection from utopia-php/http, avoiding a second URL parse.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The 'route' injection is frame-local and non-nullable inside a
matched action's hooks. Replaces \$utopia->match() lookups in api.php
and auth.php init hooks, drops the dead \$utopia inject from the
session shutdown hook, and removes the now-redundant null guards.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The 'route' injection introduced in utopia-php/http feat-safe-wildcards
is frame-local and non-nullable inside a matched action's hooks, so
the shutdown handlers in api.php and mock.php no longer need to call
match() and dereference a nullable result.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The documentsdb/vectorsdb routes are registered with
setHttpPath('/v1/documentsdb/...') with no aliases, so getPath()
returns a template containing the substring we're matching against
— and matches the prior getMatchedPath() semantics without depending
on the raw request URI.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adopts the new safe-wildcard dispatch primitive from
utopia-php/http#feat-safe-wildcards. Http::execute() is now the
re-entrant dispatch entry point and Http::match() is pure (returns
?RouteMatch). The removed Http::getRoute()/setRoute(),
Route::getMatchedPath(), Route::getPathValues() callsites are migrated
to the new API.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>