Repository navigation
Add an owner repair for guild sync roles replaced on Oct 17 - #209
Merged
Merged
Conversation
On 2026-10-17, in the first hours after the switch to a standalone bot, guild sync replaced every rank role in 234 servers with new roles of the same names. The old roles are still there, but no longer synced. >guildsync_repair takes a JSON file of each affected sync's old and replacement role ids (built from the database dumps either side of it). For each rank it relinks the old role and deletes the replacement, but only if the rank still points at the replacement, the old role still exists (checked with Discord, not the cache) and is below the bot's top role. It's a dry run unless given `apply`, and replies with the counts and a per-server report. A server's syncs now run one at a time behind a per-server lock, which the repair also takes, so a sync can't recreate a role mid-repair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Oct 17, between 15:50 and 18:20 UTC, during the first hours after the switch to a standalone bot, guild sync replaced every rank role in 234 servers (1,512 ranks) with new roles of the same names. The old roles are still on those servers, and on their members, but nothing syncs them any more. A server admin reported it.
This adds
>guildsync_repair, an owner-only text command that puts them back:Input: a JSON file attached to the command, listing each affected sync with each rank's old and replacement role ids. It was built from the production dumps from before and after Oct 17, and isn't committed.
What it changes: for each rank, it relinks the old role and deletes the replacement. It only does so if all of these hold:
Anything else is left as it is, with the reason in the report.
Dry run by default:
>guildsync_repair applymakes the changes. Either way it replies with counts of each outcome and attaches a per-server report.Members: they keep the old roles they still have. The next sync pass adds or removes rank roles as usual.
Locking: a server's guild syncs now run one at a time behind a per-server lock, and the repair takes the same lock. Without it, a sync that had already read the replacement ids could recreate a role the repair just deleted. It also stops a member-join sync and the minute loop from creating the same roles twice.
Cause: not found yet.
Test plan
tests/test_guildsync_repair.py:applyand missing attachment.ruff checkclean.apply.🤖 Generated with Claude Code