Mimickal / ReactionRoleBot

Basic, no BS Discord bot that can assign / unassign roles with message reactions
GNU Affero General Public License v3.0
53 stars 11 forks source link

Lock users when assigning or removing roles #66

Closed Mimickal closed 2 years ago

Mimickal commented 2 years ago

This change "locks" users when assigning or removing roles. This fixes a race condition where mutually exclusive roles are not being assigned correctly. (See #65 )

Note: the code is using a "mutex lock", as in, a mutual-exclusion lock as seen in concurrent programming paradigms. Confusingly, this mechanism shares a name with the bot's mutually exclusive (or "mutex") role feature, and was also necessary to fix a bug in the mutually exclusive role feature. However, these two concepts are totally distinct. One is a concept in asynchronous programming. The other just stops you from having two specific Discord roles.

Names are hard :face_exhaling: