Repository navigation
refactor: replace utopia-php/fetch with client - #13893
Merged
Merged
Conversation
Contributor
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Member
Author
|
@greptile review |
utopia-php/fetch is archived, so every Appwrite call site moves to packages/client (PSR-18) instead of absorbing it. Timeouts, the 5-hop redirect cap, headers, status checks and error handling are kept; the installer's readiness probe sends Host: $domain on each request. utopia-php/fetch leaves the root require and stays in the lock until audit and vcs are absorbed.
ChiragAgg5k
force-pushed
the
refactor/replace-fetch-with-client
branch
from
September 25, 2026 19:19
6aeb299 to
b8331e3
Compare
# Conflicts: # composer.json # composer.lock
# Conflicts: # composer.lock
pull Bot
pushed a commit
to AmirulAndalib/appwrite
that referenced
this pull request
Sep 26, 2026
withFollowRedirects() takes an optional maxHops (default Redirect::MAX_HOPS). The cURL adapter sends in-memory bodies up to php://temp's 2 MiB buffer as CURLOPT_POSTFIELDS, which cURL can replay after a 307/308; larger and file-backed bodies keep streaming. Needed so appwrite#13893 can keep fetch's 5-hop cap and body-preserving redirects.
…h-with-client # Conflicts: # composer.lock
…h-with-client # Conflicts: # composer.lock
…h-with-client # Conflicts: # composer.lock
30 of 34 tasks
loks0n
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
utopia-php/fetchis archived, so instead of absorbing it (#13828) every call site moves topackages/client.Call sites
PasswordPwned/{Appwrite,HIBP},OIDC/JwksAvatarPhotos/Photo,Image/Get,Favicon/Get,Screenshots/GetGeo/Get, MessagingWebhook,Tasks/InstallMapping
setTimeout(ms)/setConnectTimeout(ms)withTimeout(s)/withConnectTimeout(s)withTimeout(15)(client defaults to 30 s)withFollowRedirects(maxHops: 5)setAllowRedirects(false)setUserAgent()/addHeader()withHeaders([...])or a request headerRequestFactory::body(..., ContentType::JSON)/form()/query()getBody()/json()(string) getBody()/json_decode(..., JSON_THROW_ON_ERROR)catch (Utopia\Fetch\Exception)catch (ClientExceptionInterface)PasswordPwned validators and
Favicon::safeFetch()now take a PSR-18ClientInterface; tests use named fakes.Depends on #13910
Stacked on #13910, which adds
withFollowRedirects(maxHops:)and resends in-memory bodies on 307/308 inpackages/client. This PR changes no library code.Behaviour changes
Content-TypeAccept-Encoding+%20(no current value has spaces)Everything else (timeouts, redirect policy, headers, status checks, error handling) is unchanged. The installer's readiness probe sets
Host: $domainon each request, asmakeApiCall()does.utopia-php/fetchleaves rootrequirebut stays in the lock untilauditandvcsare absorbed.Test Plan
composer lintphpunit tests/unit/{Auth,Network,Utopia/Messaging,AvatarPhotos}composer refactor:checkE2E to watch: Avatars, Health geo, OAuth2 providers, Messaging webhook, installer.
Related PRs and Issues
🤖 Generated with Claude Code