8000 [HttpClient] Fix decorating progress info in AsyncResponse by jderusse · Pull Request #38633 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] Fix decorating progress info in AsyncResponse #38633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

jderusse
Copy link
Member
@jderusse jderusse commented Oct 19, 2020
Q A
Branch? 5.x
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #38631
License MIT
Doc PR /

This PR reverts #38413, and send AsyncContext to onProgress callback.

@jderusse jderusse changed the title Fix content not reported in TracableResponse decorated by AsyncResponse [HttpClient] Fix content not reported in TracableResponse decorated by AsyncResponse Oct 19, 2020
@derrabus
Copy link
Member

Can you write a test for this issue?

@BoShurik
Copy link
Contributor

With this PR I have response_content instead of response_json. Is it possible to get response_json?

@jderusse
Copy link
Member Author

Can you write a test for this issue?

Done.

With this PR I have response_content instead of response_json. Is it possible to get response_json?

We don't know how the response has been fetched (via getContent or toArray), thus we can't use response_json.
I've 2 solutions:

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Oct 19, 2020

revert #38413 and make TracableClient decorating RetryClient

that's an option.
We could then improve RetryableClient to make it report the retries in details (I'm thinking about merging the response_header and debug info of all retries in one)

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Oct 19, 2020

For the record, I skipped collecting the content consciously back then: to prevent collecting streamed responses (aka potentially long or even infinite content, think SSE).

@jderusse
Copy link
Member Author
jderusse commented Oct 19, 2020

Ready for review.
Changed the implementation to revert Client decoraton and collect retries metadata

This is how it likes:
Screenshot from 2020-10-19 22-38-26

@derrabus derrabus added this to the 5.2 milestone Oct 19, 2020
@nicolas-grekas nicolas-grekas changed the title [HttpClient] Fix content not reported in TracableResponse decorated by AsyncResponse [HttpClient] Fix decorating progress info in AsyncResponse Oct 20, 2020
@jderusse jderusse force-pushed the fix-38631 branch 2 tim 8000 es, most recently from 51440f2 to 5c0d95d Compare October 20, 2020 09:55
@jderusse jderusse force-pushed the fix-38631 branch 2 times, most recently from 073b73b to 968c3a2 Compare October 20, 2020 12:39
@fabpot
Copy link
Member
fabpot commented Oct 21, 2020

Thank you @jderusse.

@fabpot fabpot merged commit 508ec9c into symfony:5.x Oct 21, 2020
@jderusse jderusse deleted the fix-38631 branch October 25, 2020 19:48
@fabpot fabpot mentioned this pull request Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0