-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Notifier] Custom Chatter instances have a *VERY* unexpected behaviour #41208
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
Comments
@wucdbm You could try out #39353 and check if this fixes your problem. @OskarStark #39353 is not merged yet unfortunately. |
You are right it will be released in 5.4 |
#40982 Does not solve my issue, it being that messages (by default) are channeled through the bus, not the transport, which afterwards uses the default bus, rather than my transport OR being able to configure an alternative channel to send a message to on a per-message basis #39353 looks like this will help - I can then configure the message bus to something invalid and force null in the Chatter I am only unsure about the |
@fabpot as you are the inventor of this component, does this sounds familiar to you? |
Hey, thanks for your report! |
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3 |
Could very well still be relevant, we did workaround this. |
Symfony version(s) affected: 5.2.4
Description
When configuring custom Chatter instances like so
The problem is this code within the Chatter
And the fact that its $bus argument gets autowired as my configuration has autowiring enabled in defaults.
I had to add
autowire="false"
to my service, which is quite un-intuitive given I was using a custom setup of the component for the first time.How to reproduce
Code above should be enough to reproduce or understand the issue.
Possible Solution
I am very unaware what the purpose of that bus is, besides possibly delaying the messages until after the request has been served?
In either case, it looks like a design flaw to me. Why not decorate the transport with a service that depends on the Bus implementation?, so rather than directly sending through the transport, messages are sent to the bus first, and then through the transport, somehow.
Anyhow, I was only attempting to send a message to a different channel in Slack, so we're probably looking at the wrong barn.
I think we should focus efforts on figuring out why setting a recipieng other than the default channel in slack won't work, then this is a no-issue as far as one is only attempting to send messages to another channel.
If however somebody needs to send messages to several Slack (or any other service?) apps, it gets ugly again, because once the Bus sneaks in, everything is sent through the default Chatter instance.
Additional context
My goal was to be able to send messages to separate channels. The problem is, setting the recipient @ the
MessageOptionsInterface
instance (in my case, SlackOptions) did not work. I have investigated to the point where calling$message->getRecipientId()
indoSend
ofSlackTransport
returns NULL regardless of what I do, when using either of the transports: The default one defined by the framework, or my custom instances.At present, my services are configured with an explicit
autowire="false"
to avoid injecting the Bus, and they work because I use a different DSN for each, which has the channel defined in the DSN. Even so, trying to send to another channel (for testing the sake of testing this issue) via MY OWN SERVICE ID, which avoids the Bus thingy, configuring another channel in the message's options still won't work. I did not investigate further why that is.The text was updated successfully, but these errors were encountered: