Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpClient] Enable using EventSourceHttpClient::connect() for both GET and POST#51558
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedSep 4, 2023
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
derrabus commentedSep 4, 2023
This looks like a new feature to me, especially since we need to change a method signature. Also, please note that we usually don't merge changes that are not covered by tests. |
wivaku commentedSep 5, 2023
What you say makes sense. Technically it's indeed not a bug. At the same time, was not sure it really deserved being called a feature. |
stof commentedSep 5, 2023
@wivaku we still need tests to cover the new feature you are adding (which is here to prevent regressing on it which would break it). and anything that is not a bug fix is treated as a new feature going into the next minor version. |
wivaku commentedSep 5, 2023
What both of you say makes sense. Technically it's indeed not a bug. At the same time, was not sure it really deserved being called a feature. POST was already allowed (using As the change maintains backwards compatibility (before: always GET, after: optional argument that defaults to GET) and My knowledge of the internals of the code is not sufficient to add one though. |
stof commentedSep 5, 2023
@wivaku And the rule is that anything that is not a bug fix goes into the next minor version. It is not about deserving being called a feature or no.
The new test is not there to ensure this PR maintains backward compatibility (that's what the existing test ensure). It is there to ensure that *future PRs do not break the change you introduce in this one.
Look at the existing tests of the EventSourceHttpClient. The test for POST will be quite similar except that the mock will expect being called with a POST method. |
wivaku commentedSep 5, 2023
Ok, attempted to add test. Similar to the GET test, but only checking the response, not the responseStream as this is already covered by the GET test. All this, including Mockery tests are quite new to me, so apologies if I'm doing something wrong. Because of my lack of experience the way I read the Mockery test is confusing to me: in the test I specify that the response will be for the method and then I test if the response I get is indeed that response. |
nicolas-grekas left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the PR. Please add a line to the changelog of the component about this.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpClient/Tests/EventSourceHttpClientTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpClient/Tests/EventSourceHttpClientTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I fixed my review comments.
nicolas-grekas commentedSep 14, 2023
Thank you@wivaku. |
Uh oh!
There was an error while loading.Please reload this page.
Fix so connect() can be used for SSE connections that require POST, e.g. GraphQL SSE subscriptions. This so we don't have to manually create the request() and include all of the options that are used for connect().