Repository navigation
Conversation
…ir account Account deletion deleted every sync_relay_group_rules row the account saved last, so a Group set to No access became visible to members. The column is now nullable, an earlier table is rebuilt with its rows, and the purge clears the author as it does for folder rules. Fixes #4587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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.
Problem
When an admin deleted their account, the relay deleted every Group rule that admin had saved last. A Group the admin had set to "No access" then fell back to the member level, so every member could read it, and write to it at Edit level.
sync_relay_group_rules.changed_by_user_idwasNOT NULL. Account deletion's purge deletes rows whose*user_idcolumn names the deleted account. Folder rules avoid this: the purge sets their author to NULL.Change
sync_relay_group_rules.changed_by_user_idis now nullable. A relay that already has the table (migrationworkspace-group-rules-v1) rebuilds it underworkspace-group-rules-v2when it starts and keeps every row. The rebuild runs in the relay's schema transaction, and it checks the earlier table's exact schema first.changed_by_user_idon Group rules as it does on folder rules. A Group's rule now outlives whoever saved it last.Risk and recovery: after this build migrates a relay, an earlier build refuses to start on it, because it expects the
NOT NULLcolumn. Reverting the code doesn't undo the migration.Fixes #4587
Verification
keeps a Group hidden after the admin who hid it deletes their account(workspaceMembers.test.ts): an admin sets a Group to No access and then deletes their account. The test checks that a member's pull doesn't contain the Group, that reading the Group answers 404, that posting in it is refused, and that the owner still sees the rule. On the base commit it failed because the member's pull contained the hidden Group. With the change it passes.keeps an earlier build's rules and lets their author be cleared(storage/groupRules.test.ts): a v1 table with a row upgrades, keeps the row, accepts a NULL author, and setup runs again cleanly.Council review
Rounds: 2 in total (1 pre-pass, 1 council). Size: +27 product lines, 13 removed (budget 25).
Follow-ups:
sync_relay_workspace_level_changesdeletes its row the same way when that admin deletes their account. This loses who set the members' level, but no access changes.rebuildTableshelper.🤖 Generated with Claude Code