setContext() is now public on Http (utopia-php/http#251). The graphql
resolver no longer needs to reach into the per-request container
directly to swap the active match for nested resolution — it can just
ask Http to do it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Upstream removed Adapter::getContainer() in favor of a single
public reader Adapter::getContext(): Container that returns the
container for the current execution context (per-request inside
a request, global outside one). Migration is a one-line rename.
The only call site was the installer's bootstrap, which runs at
boot and therefore receives the global container — same semantics
as before.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Upstream now returns null instead of throwing when the request hasn't
been matched yet, so the defensive try/catch wrappers in app/http.php
and Resolvers.php are no longer needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces \$utopia->match(\$request) calls in the project, team, and auth
resolvers with the per-request RouteMatch injected directly via DI:
- app/init/resources/request.php — project / team resource closures now
declare 'match' as a dependency and read \$match?->route.
- app/controllers/shared/api/auth.php — auth init hook injects 'match'
instead of resolving via \$utopia.
- app/controllers/shared/api.php — drop the redundant re-match in the
storage cache init hook; \$route from the action's \$match inject is
already in scope.
Only Resolvers::resolve still calls \$utopia->match(...) — that path
genuinely matches a synthesized sub-request URL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps utopia-php/http to the latest fix/concurrency-shared-state, which
collapses the separate route / matchedPath / arguments context keys into
a single immutable RouteMatch under the 'match' key.
- Replace ->inject('route') / ->inject('matchedPath') with
->inject('match'), reading \$match->route / \$match->path.
- Replace the manual array_merge(\$route->getPathValues(), \$request->
getParams()) workaround in api.php's shutdown hook with the framework-
provided \$match->arguments — same data the action saw, no path-value
reconstruction needed.
- Update GraphQL resolver to snapshot/restore the 'match' value instead
of 'route'.
- Update top-level call sites in app/http.php that read from getResource
('route') to read getResource('match')->route.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The api shutdown hook substitutes route labels like
\`cache.resource = 'file/{request.fileId}'\` against \$requestParams. We
were reading those from \$request->getParams(), which only returns body
or query params — path params (\`fileId\`, \`bucketId\`) were missing,
so cache documents got written with literal \`file/{request.fileId}\`
strings and subsequent cache hits 404'd because the placeholder was
treated as a real fileId.
Merge \$route->getPathValues(\$request) ahead of \$request->getParams() so
path params are available for substitution. Replicates the previous
behaviour of \$route->getParamsValues(), which was populated by the
upstream Hook param writeback that has since been removed.
Also rename the per-request container variable to \$context and the
loader callable to \$registerContext in app/http.php to match the new
upstream terminology.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Use ->inject('route') and ->inject('matchedPath') in actions instead of
reading via \$utopia->getResource() — this was the cause of the e2e 500s,
the bus resolver was hitting the global container after the upstream
Adapter::getContainer() semantics changed.
- Switch the bus resolver in app/http.php to use \$swooleAdapter->getContext()
so per-request resources (locale, platform, dbForProject) resolve from the
per-coroutine context container.
- Drop the dead ?->label('router', true) calls in general.php — the label was
never read.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adopts the breaking changes from utopia-php/http#251 (concurrency races on
shared Http/Route singletons):
- Replace `Http::getRoute()` / `setRoute()` with `getResource('route')` and
context container writes.
- Replace `Route::getMatchedPath()` with `getResource('matchedPath')`.
- Use `Adapter::getContext()` for the per-request container in `app/http.php`
(`getContainer()` now always returns the global singleton).
- Read request params from `$request->getParams()` in the api shutdown hook
instead of `Route::getParamsValues()`, which is no longer populated.
- Update Swoole promise context key to `__utopia_http_context`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>