Migrate from custom Client to Utopia\Fetch\Client#204
Merged
ChiragAgg5k merged 12 commits intomainfrom Dec 11, 2025
Merged
Conversation
- Remove custom tests/Client.php class - Add utopia-php/fetch dependency - Update ExecutorTest to use Utopia\Fetch\Client - Add wrapper method to maintain backward compatibility with existing tests - Fix deprecated nullable parameter warnings in ExecutorTest.php This migration standardizes HTTP client usage across the codebase using the official Utopia Fetch library instead of a custom implementation.
When using streaming callbacks, the response body is consumed by the callback, so we should not attempt to decode it. This fixes the JSON decode error in testLogStream and other streaming tests.
Instead of reusing a single client instance and accumulating headers, create a new Client instance for each request with base headers + request-specific headers. This matches the original behavior where headers were merged per-request without modifying the instance.
loks0n
approved these changes
Dec 10, 2025
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.
Summary
Migrates the test client implementation from a custom
Tests\Clientclass to the officialUtopia\Fetch\Clientlibrary.Changes
tests/Client.phpclassutopia-php/fetchdependency tocomposer.jsonExecutorTest.phpto useUtopia\Fetch\Clientcall()method to maintain backward compatibility with existing test codeExecutorTest.phpBenefits
Test plan