-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] Add a canceled state to the ResponseInterface #34044
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
Conversation
Thanks! |
I tried but:
|
Yes, that's desired behavior, for all clients that didn't get the content before canceling: But the check just needs to assert the result of |
Ah, I guess I was thinking way too complicated :) Test added. |
d237179
to
22e7123
Compare
Appveyor failures look unrelated :) |
136a21f
to
bbb8ed1
Compare
Thank you @Toflar. |
…face (Toflar) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [HttpClient] Add a canceled state to the ResponseInterface | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | | License | MIT | Doc PR | none yet As discussed in terminal42/escargot#7 with @nicolas-grekas. However, I'm not quite sure about the tests here because it looks like the `MockResponse` always throws a `TransportException` when I cancel a response, even if I call `$response->getContent(false)`. Is that a desired behaviour? :) Need some guidance here to finish that PR maybe. Note: I've also sorted the info keys alphabetically and added their types because it feld incomplete and a bit random otherwise. Hope that's okay :) Commits ------- bbb8ed1 [HttpClient] Add a canceled state to the ResponseInterface
This PR was merged into the 4.3 branch. Discussion ---------- [HttpClient] skip tests implemented in 4.4 | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Needed after #34051 and #34044 Commits ------- ae86ab1 [HttpClient] skip tests implemented in 4.4
This PR was squashed before being merged into the 4.4 branch (closes #12526). Discussion ---------- Documented $response->getInfo('canceled') Documented the new `canceled` information introduced in symfony/symfony#34044. Reading the docs, I wonder if we need to catch any `Throwable` and also set `canceled` to `true` @nicolas-grekas? Commits ------- 71cff04 Documented $response->getInfo('canceled')
As discussed in terminal42/escargot#7 with @nicolas-grekas.
However, I'm not quite sure about the tests here because it looks like the
MockResponse
always throws aTransportException
when I cancel a response, even if I call$response->getContent(false)
. Is that a desired behaviour? :) Need some guidance here to finish that PR maybe.Note: I've also sorted the info keys alphabetically and added their types because it feld incomplete and a bit random otherwise. Hope that's okay :)