[Mutes] Re-joining guild is nullifying the mute if autorole exist #6329
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#6329
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Red version are you using?
3.5.7
Cog name
Mutes
Command name
mute
What did you expect to happen?
This came to our attention when a few users of our server recently were able to re-join the server with
no muted- bypassing the mute persistent (when they were muted permanently beforehand)So I tested it and it turns out, you can actually bypass mute by
rejoininga server, in the presence ofANYautorole/joinrole cog - In a system where you set certain role(s) asjoinrolewhich gets added to the user upon joining the server.So, to answer the question, The expected behavior would be - Persistent Mute over guild Re-Join.
(I know Red already does but it's failing, details are as follows - )
What actually happened?
Findings from the test:
autorolesystem is present on a completely different 3rd party bot that has no connection with red & the muting is done withred instance. Which is really weird. Same result here - roles that are set as joinrole/autorole gets added to the user but not the mute role.Mutescog. (For example, if you execute say, 3 commands in one go, with one invoke - then chances are any of the 2 commands won't even get executed in the first place 5 out of 10 times - but this requires its own issue).extendedmodlog - by trusty) support that statement - "The mute role got removed by the bot." Now yes it's true that extendedmodlog guesses the events but still as there's nothing in the server audit log that says otherwise.How can we reproduce this error?
Test 1 -
MutesandAutoRoleCogs are on the same instanceLoad
Mutescog & set a muted role + logs.Install ANY autorole/joinrole cog and set a test role to be added as autorole - cog that adds a role as soon as a human joins a guild.
Test it in a 3k+ server.
Mute a test-account/user for any duration - enough so it can cover the test duration.
Leave the guild after that - from that user account.
Re-join as the same user.
You will notice the user doesn't have the mute role anymore, however they will have the autorole.
extendedmodlogby trusty (verified) to check further.Test 2 -
Mutesis on the Red instance,Autoroleis set to any 3rd party bot.Mutescog & set a muted role + logs.235148962103951360) - it has a autorole module, set any test role as autorole/joinrole.Red instance- enough so it can cover the test duration.You should be able to notice the same result - that the user doesn't have the mute role anymore, however They will have the autorole.
Anything else?
I've tried to fill this issue, with as much info as possible, sry if it is still not enough.
If it's not enough or requires more testing, then I'd love to give a hand. Please ping me if you need more info or testing.
Btw I believe red current versions are not the reason for this issue, since these are minor bump 3.5.x and this could be an overlong persisting issue coming from 3.5.0 dpy 2.0 causing not just mute persistent problem but also multiple role add & remove issue.
I can't reproduce test case 1, my bot properly gives back both roles. Though I didn't do it in a 3k+ server since I don't have access to a server that large where I can easily test something like this. Please try this on a fresh instance and report back if you still experience this issue, to rule out any potential for other cogs to be conflicting in some way (ie exclusive roles).
Sure, Here are the results.
Test case 2 -
Mutesis on the Red instance,Autoroleis set to any 3rd party bot.test-muterole to avoid conflicting with other roles.(Testing Server is 3k+ here as well).
autoroleI used two different 3rd party bots; one that I had mentioned earlier carl bot (235148962103951360) another one is a red instance different than the bot I'm muting with ofc.autorole, gets added first (and I think this is purely because of how fast the 3rd party bots/instances are - in terms of adding autorole), and whenever the autorole gets added first, themute rolegets removed. 👇 - There are No other influences whatsoever.Test case 1 -
Mutes&Autoroleare on the same New Red instanceEverything is the same as test case 1. (3k+ test server as well)
Results:
mute rolegot removed &autorolegot added alone. 2/6 times themute rolegot added ONLY but noautorole.Tl;dr: Whenever a role is getting added first (upon joining the guild), the
mute rolesomehow gets removed from the user.Doesn't matter which bot you're using, if its fast enough adding role(s), then the mute role will get removed leading to nullifying the process overall.
I don't have any other autorole or exclusive role cogs in any of the instances, as a precaution I had quarantined ALL the other bots before doing the test. (Had done it earlier as well)
One more thing,
Since test servers (with <100 members) are not ideal for testing - due to several reasons and since it's kind of hard to get your hands on 3k+ servers, what we can do is - we can provide a
private spacefor ANY ORG/staff member who may wish to come in, to test this out in our server, yes with their own bots to pinpoint the root of this issue and make it better for everyone else.I think from our end, we as a server, will be able to provide as much info and help as is needed to solve it.
@Flame442 Flame, if you wish you can come to our server with your own bot
.gg/thestarshipthat'sThe Starship(this is where the test results are from - and for the "13-year-olds" no this is Not an advertisement, this is a mere attempt to find what is causing it). We will provide you with all you need to see this phenomenon happening with your own eyes and may be able to find the reason behind it.Servers under 100 might not be able to showcase this issue 10/10 times but I believe any server 1000+ with lots of roles, should be able to recreate the mentioned issues (both test cases: 1 and 2).
While it seems like this issue is possible to reproduce given the specific server environment you have, it does seem like it requires some stars to align in order to happen. I'm also not entirely convinced we've tracked down the source of the issue, but we at least found that adding a sleep before adding the autoroles or moving the autorole to the default onboarding roles will fix this issue. I think it's a bit too niche and a bit too risky to fix in Mutes, since the only way to do it would be to delay adding the mute role on rejoin. For that reason, I'm going to consider this an issue that would be better fixed in other ways, namely in the 3rd party autorole cogs.