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
| #!/usr/bin/env python | |
| """ | |
| Fix users in the "not_found" state: user.inbox_project_id is set but no project | |
| with is_user_inbox=True exists for that user on any shard. | |
| For each user: | |
| 1. Look up the project referenced by user.inbox_project_id on its shard. | |
| 2. If found: mark it as the user's inbox (set is_user_inbox=True on the model). | |
| 3. If not found: clear stale refs on the user, then create a new inbox project. |