-
Notifications
You must be signed in to change notification settings - Fork 632
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
Bridge between multiple rocketchat servers only receives messages from the first one #1645
Comments
This also happens if
|
I just tested switching the rocketchat server b to using webhooks for send and receive.
So you can use webhooks for one of the servers as a workaround. Edit: This does only allow you to bridge a single channel per defined server. You can workaround this by setting up a seperate server block for each channel using identical data but different webhooks. It get's very messy with just a few channels. Edit again: This workaround works, even for multiple channels per server. The |
I think I found the root cause: matterbridge/vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/realtime/messages.go Line 20 in 80d3033
The Rocket.chat client has this global bool flag that checks if the subscriber has already been added. The problem is that two different clients will of course use the same bool flag and the second client also uses the same bool flag and will therefore not add a subscriber, and doesn't get notified of any messages. I would like to provide a fix, but I don't know where exactly - the original rocketchat repo, the forked one in matterbridge/Rocket.Chat.Go.SDK or the vendored code? All these three places seem to have different code from each other. Edit: I've implemented a fix in https://github.com/patrick246/matterbridge, right in the master branch. This modifies vendored code which I'm not so sure about :) |
@patrick246 the right place in this case would be to submit a PR in https://github.com/matterbridge/Rocket.Chat.Go.SDK and in addition in the upstream repo. the matterbridge fork is quite old, so i don't know if it would be some effort to upgrade it to the latest version. i'll have a look today an see how much effort this is :) |
That's the interesting part: The Matterbridge fork of the Rocketchat go sdk is too old to contain this bug, it's only present in the vendored code and in the upstream sdk. |
hm, not keeping the vendored code and the fork specific to the project in sync is an unorthodox choice... but that just means upstreaming the fix is the best option. |
i submitted a PR in upstream rocketchat sdk (RocketChat/Rocket.Chat.Go.SDK#46) and here's my fork with the changes integrated: https://github.com/tachiniererin/matterbridge i'll create a PR for that too as soon as the upstream stuff gets merged. |
Describe the bug
When configuring multiple rocketchat servers, only the first one added to a gateways inout section is able to receive messages. All can send messages but only the frist can receive them.
To Reproduce
Expected behavior
I see the message on rocketchat a in channel #test1
Screenshots/debug logs
No Logs or anything is produced for writing in rocketchat b after startup, even with -debug.
Startup looks like that:
Environment (please complete the following information):
version: 1.23.2 73ec02ab
Additional context
The text was updated successfully, but these errors were encountered: