Skip to content

[HttpClient] Bug on upcoming 7.3 for TraceableHttpClient profiling #60481

Closed
@silverbackdan

Description

@silverbackdan

Symfony version(s) affected

7.3-BETA2

Description

I cannot see any notes in the ChangeLog about this update to add a disabled constructor argument and an additional check before profiling the HttpClient
https://github.com/symfony/http-client/blob/7.3/TraceableHttpClient.php#L27-L43

In my tests, this is preventing some http client calls to a cache server endpoint from being collected, resulting in a false-negative test result stating my application has not done the HTTP request to clear a resource from a cache.

Additionally I cannot see docs just yet on manually disabling or enabling the profiler.

During the test, when $this->disabled?->__invoke() is called, invoking ProfilerStateChecker, $this->container->get('profiler') is not retrievable from the container yet. $this->container->get('profiler')?->isEnabled() returns null as a result.

I've traced that the _construct is not being called on the Profiler until after the Http requests have been made now. Has a priority changed, or something new required in Behat tests for this?

How to reproduce

I'm sorry this is not a minimal reproduction, but sometimes having this brought up will quickly get a eurika moment from the core devs. But the tests are failing on the next version testing in my bundle here:
https://github.com/components-web-app/api-components-bundle/

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions