-
Notifications
You must be signed in to change notification settings - Fork 625
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
Messages from Discord to Slack duplicated on Discord side #1039
Comments
Could be related to #1018. Doing some debugging... With this patch on this file diff --git a/bridge/slack/handlers.go b/bridge/slack/handlers.go
index 10ed0ae5..04d30fed 100644
--- a/bridge/slack/handlers.go
+++ b/bridge/slack/handlers.go
@@ -125,6 +125,10 @@ func (b *Bslack) skipMessageEvent(ev *slack.MessageEvent) bool {
}
// Skip any messages that we made ourselves or from 'slackbot' (see #527).
+ fmt.Printf("Comparing ev.Username[%#v] == sSlackBotUser[%#v]\n", ev.Username, sSlackBotUser)
+ fmt.Printf("Comparing (b.rtm!=nil)[%#v] && ev.Username[%#v] == b.si.User.Name[%#v]\n", b.rtm != nil, ev.Username, b.si.User.Name)
+ fmt.Printf("Comparing attachment stuff. Result %#v\n", (len(ev.Attachments) > 0 && ev.Attachments[0].CallbackID == "matterbridge_"+b.uuid))
+ fmt.Printf("Slack event: %#v\n", ev)
if ev.Username == sSlackBotUser ||
(b.rtm != nil && ev.Username == b.si.User.Name) ||
(len(ev.Attachments) > 0 && ev.Attachments[0].CallbackID == "matterbridge_"+b.uuid) { This output is given:
And
|
More context. Running the following code (using the bot token)
Sends this message: Probably because Logs this:
(edit later: this is because Click here for lots of screenshots — mainly about how I have two bot users for some reason. TLDR - reinstalling my app got rid of a ghost bot user, and it doesn't affect this issue at allMore interestingly, my app appears in the apps list, which I can PM: The old version of the same app, also appears in the contact list: Which is apparently a deactivated account: And the app is apparently disabled: Clicking "How does chat-bridge work?" shows this Clicking "Settings" or "View in App Directory" will both link to https://multitheftauto.slack.com/apps/AF4ACB3V2-chat-bridge, which says "There's been a glitch": On Slack, "Your Apps", my Observe "legacy Bot User", which is possibly why I am running into issues. Note that inviting the bridge shows "Bridge" and not "chat-bridge". Originally (when I first set the bridge up) it would say On another Slack workspace (with a different app so a different token, but the same configuration), The buggy one: On the Do you think I should just delete the app and start over? Or should I keep this around so that we can be legacy bots work with matterbridge? Should we support legacy bots? Maybe it's just an old bot that I forgot I created and is now just lying around dead, despite being deleted. Who knows. Edit: okay so I reinstalled the app and the ghost |
I'll try and see if we can make this use the ID only, and not compare usernames. It still won't explain why it works fine on Linux (with an older version of matterbridge, which has a different copy of the library). But /shrug, it should solve the issue. |
I also experienced the same issue with a simple Slack<->Discord bridge setup. Can confirm the issue but I have not tested the fix. |
This is a regression from 42wim#581 (comment) Behaves the same as matterbridge/slack@95190f1
This is a regression from 42wim#581 (comment) Behaves the same as matterbridge/slack@95190f1
This is a regression from 42wim#581 (comment) Behaves the same as matterbridge/slack@95190f1
This is a regression from #581 (comment) Behaves the same as matterbridge/slack@95190f1
Matterbridge upstream released a new minor feature release: https://github.com/42wim/matterbridge/releases/tag/v1.17.0 There are a good number of changes, including support for Microsoft Teams. (What?!) But the relevant bits of the changelog for us are below: * general: support JSON and YAML config formats (42wim/matterbridge#1045) * irc: Be less lossy when throttling IRC messages (42wim/matterbridge#1004) * slack: Use upstream slack-go/slack again (42wim/matterbridge#1018) * slack: Ignore ConnectingEvent (42wim/matterbridge#1041) * slack: use blocks not attachments (42wim/matterbridge#1048) * slack: Fix 42wim/matterbridge#1039: messages sent to Slack being synced back (42wim/matterbridge#1046) And a hat tip to our upstream devs who made this release possible: @qaisjp, @jakubgs, @burner1024, @notpushkin, @MartijnBraam, and @42wim. This upgrade is currently running in production without issue. This commit brings the config management up to date with what is currently running out in prod. Signed-off-by: Justin W. Flory <git@jwf.io>
Matterbridge upstream released a new minor feature release: https://github.com/42wim/matterbridge/releases/tag/v1.17.0 There are a good number of changes, including support for Microsoft Teams. (What?!) But the relevant bits of the changelog for us are below: * general: support JSON and YAML config formats (42wim/matterbridge#1045) * irc: Be less lossy when throttling IRC messages (42wim/matterbridge#1004) * slack: Use upstream slack-go/slack again (42wim/matterbridge#1018) * slack: Ignore ConnectingEvent (42wim/matterbridge#1041) * slack: use blocks not attachments (42wim/matterbridge#1048) * slack: Fix 42wim/matterbridge#1039: messages sent to Slack being synced back (42wim/matterbridge#1046) And a hat tip to our upstream devs who made this release possible: @qaisjp, @jakubgs, @burner1024, @notpushkin, @MartijnBraam, and @42wim. This upgrade is currently running in production without issue. This commit brings the config management up to date with what is currently running out in prod. Signed-off-by: Justin W. Flory <git@jwf.io>
Describe the bug
Message is duplicated in Discord because of bot message in Slack
To Reproduce
Expected behavior
Message should not be duplicated.
Screenshots/debug logs
If applicable, add screenshots to help explain your problem.
Use logs from running
matterbridge -debug
if possible.Discord
Slack
Appears as expected on Slack (with my photo and name).
Logs
click here
Environment (please complete the following information):
matterbridge -version
git rev-parse HEAD
Problem happens on my test instance
6b4b191 + #1036 (needed to make it compile), macOS
Does not happen on my production instance
c0be3e5 + few tiny patches, Linux
Additional context
Please add your configuration file (be sure to exclude or anonymize private data (tokens/passwords))
Related to #219
The text was updated successfully, but these errors were encountered: