fix(identity): harden admin checks and campsite_user_id backfill - #2166
Conversation
Always treat monorepo.admin as runtime admins (union with Cedar), resolve identity backfill PK collisions before renaming handles, and return 404 when a CL reviewer is missing instead of 500.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6de75dd97
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for table in [ | ||
| "cla_sign_status", | ||
| "user_approval_status", | ||
| "user_notification_settings", |
There was a problem hiding this comment.
Preserve notification preferences before deleting settings
When a handle and its campsite id both already have user_notification_settings rows, this collision path deletes the handle settings row. The preferences table has an ON DELETE CASCADE FK to settings (jupiter-migrate/src/migration/m20260224_230000_create_notification_center.rs:159-160), so the delete removes all of the handle's per-event notification overrides before the later rename/merge can move them. Users with pre-backfill notification overrides lose those preferences during identity backfill; merge/update preferences before deleting the settings row, or exclude settings from this delete path.
Useful? React with 👍 / 👎.
Always treat monorepo.admin as runtime admins (union with Cedar), resolve identity backfill PK collisions before renaming handles, and return 404 when a CL reviewer is missing instead of 500.