You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A settings save can undo an admin moderation ban #1039
Found by review on #1035, in main's code (src/utils/admin-moderation.ts:172), not in the merge itself.
updateAdminModerationLimits reads and rewrites the whole settings file while holding the moderation lock. PatchAdminSettingsController reads and saves the same file without taking it. Two workers can therefore interleave, and an ordinary admin settings save silently reverts a ban written by the other request.
Fix: every writer of the settings file takes the same lock — the moderation lock, or a settings-file lock both call sites acquire — and re-reads inside it rather than saving a document read before the lock was held.
Activity