Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Notifier] [Bridges] Provide EventDispatcher and HttpClient to the transport#52998
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 commentedDec 11, 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 |
OskarStark commentedDec 12, 2023
Hi, thanks for the PR, as this is a new feature, please target 7.1 |
rdavaillaud commentedDec 12, 2023 • 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.
Is it really a new feature or an oversight?
Currently, the hooks aren't working with the FakeSms/FakeChat and Mercure as they should. |
OskarStark commentedDec 12, 2023
Not sure, from a technical POV it is a new feature, because they were never meant to dispatch those events, but I can understand your point. |
rdavaillaud commentedDec 15, 2023
I will give some argument in favour of a bugfix 😁 Those transports (at least the Fake* ones) are intended to be used in dev/test, but we cannot test the events behaviours, and it is not documented that they don't support those events. Technically, the transports classdoes have everything to support the dispatch of those events, they correctly extends the AbstractTransport class and call the extended class constructor passing the two HttpClient and EventDispatcher argument. The factories, in the other hand, don't handle the extended AbstractTransportFactory class constructor arguments. As all the other factories don't override the constructor, there is no precedent. @fabpot , as you are the designer of the component and in order to determine if this is bug since 5.3 or a new feature for 7.x., do you have an opinion on that : does every TransportFactory need to pass EventDispatcher and HttpClient ? I will target whichever you finally decide, tell me. |
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.
Works as a bugfix to me. It's surprising that we'd rely on the default http client on purpose.
Can you also remove the use of named arguments? We don't use them in core except here and it looks like an oversight.
Can you please check on 6.4/7.1 if there are more bridges that would need a similar change and submit a PR if yes?
fabpot commentedDec 20, 2023
Thank you@rdavaillaud. |
rdavaillaud commentedDec 20, 2023
I will try to see what I can do with this, I need to dig in and understand why. I would open a PR then.
From what I can see, those three bridges are the only ones. |
OskarStark commentedJan 2, 2024
Behause we missed to add a conflict in FrameworkBundle 6.4.2 to require fake-chat and fake-sms at least in 6.4.2 ends up in the following error: The solution is to upgrade the notifier bridges to cc@xabbuh |
xabbuh commentedJan 2, 2024 • 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.
The same issue should be observable too when updating FrameworkBundle from 5.4.33 to 5.4.34, 6.3.10 to 6.3.11 or from 7.0.1 to 7.0.2 without also upgrading these bridges. |
rdavaillaud commentedJan 2, 2024
Damn, I am not used to those dependencies conflicts, sorry. What are the rules I missed? I suppose removing the use of named arguments as requested by@nicolas-grekas is the way to go, but I didn't worked on this until now. And this will maybe need some other things to do in composer that I don't know of. @OskarStark, as you are the first contributor on these bridges, can you explain to me why was it necessary at the first place to put those lines in Framework Bundle? This may put me in the fast lane to understand. |
nicolas-grekas commentedJan 2, 2024 • 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.
Removing named arguments is the way to go, no need for anything else (no conflicts). |
xabbuh commentedJan 2, 2024
see#53341 |
…non-existent named-arguments (xabbuh)This PR was merged into the 5.4 branch.Discussion----------[FrameworkBundle] append instead of replacing potentially non-existent named-arguments| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues |Fix#52998 (comment)| License | MITCommits-------96d2e68 append instead of replacing potentially non-existent named-arguments
Some Notifier transport factories are redefining the class constructor, but aren't passing the HttpClient nor the EventDispatcher.
As a result, those transports are not providing Notifier event hooks.
This PR adds those dependencies.