aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cogs/sync
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2019-09-14 18:01:53 +0200
committerGravatar Sebastiaan Zeeff <[email protected]>2019-09-14 18:01:53 +0200
commitb8eee655cbfd7767912134c934f962e2aa76415b (patch)
tree50ca8a67624ebe28b6489cdbc98ecbd08598f443 /tests/cogs/sync
parentFixes all URLs in the Site cog. (diff)
Deal with multiple active infractions in database
While there are measures to prevent duplicate active infractions at the side of the bot, there's no formal restriction at the sid of the database. This means that it's possible for a user two get two active ban infractions or two active mute infractions at the same time, for instance after a manual table edit in Admin. This leads to an inconsistent state when unmuting/unbanning that user, as the ban or mute role will be removed on Discord, but only one of the entries in the database would be set to inactive, while the other(s) remain active. This means that an unmuted user will be remuted if they leave and rejoin the Guild. To handle this, I've inserted code that sets all the infractions to inactive and cancels all related infraction tasks (in the case of temporary infractions) when issuing an unban or unmute command. A note will be added to the mod_log embed to notify us as well.
Diffstat (limited to 'tests/cogs/sync')
0 files changed, 0 insertions, 0 deletions