RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.56k stars 10.58k forks source link

SlackBridge - potential bug/conflict in channel names #22218

Open 3id0 opened 3 years ago

3id0 commented 3 years ago

Description:

This is a weird one:

I have Rocket.Chat server "RC" linked to a Slack workplace "SLACK".

One of the channels we paired is #0_general i.e. on both SLACK and RC we created a new channel #0_general and added the bot to SLACK/#0_general. On SLACK, there is no channel #general. But on RC, there is a channel #general (which predates the SlackBridge setup btw).

In RC, if I post a message in RC/#general it is only posted in RC/#general, since there is no channel SLACK/#general and, still in RC, if I post a message in RC/#0_general it is sent to SLACK/#0_general. All good there. But... In SLACK, if I post a message in SLACK/#0_general, then the message is received in RC/#general but never received in RC/#0_general !

I guess some characters (numbers and _) are ignored in SlackBridge ??? In any case as you can see this results in a very weird behavior from a user standpoint.

EDIT: After renaming the channel #0_general to #0_general_a in SLACK, the channel #general in RC was automatically renamed to #0_general_a (the channel RC/#0_general however wasn't changed)

Server Setup Information:

morehek commented 3 years ago

We had similar problem regarding user permissions.

In our case API endpint "/api/v1/chat.postMessage" was the problem.

Before upgrade things worked. After upgrade to 3.15.0 we were getting error: StatusCodeError: 400 - {"success":false,"error":"Not enough permission"}

Documentation at Post Message says:

IMPORTANT
You only can send alias and avatar properties if your user has the bot role. We implement this rule to avoid users to impersonate other users.

After adding bot role to appropriate user it worked.

3id0 commented 3 years ago

Thanks for the tip @morehek ! Adding the "bot" role to all users who have an account with the same name in Slack solves issue #22217

Just curious: Where exactly do you see the error StatusCodeError: 400 - {"success":false,"error":"Not enough permission"}? My error is not formatted the same way, strangely.