Repository navigation
Open shifts follow-up: keep post keys across a reload, clear them on account deletion - #3566
Conversation
…account deletion - Post keys are kept in the tab's session storage, so a retry after a reload sends the same key and the server answers with the shift it already saved. - roster_open_post_keys.posted_by now references auth.users on delete set null, like roster_open_shifts.posted_by (migration 20261015181500, not yet sealed). - Account-deletion SQL test covers the post keys. Roster alerts test checks the new post takes the offer path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuYbdEGXeMntVA9KMgtAEx
Adds the new migration's hash only. No existing entry changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuYbdEGXeMntVA9KMgtAEx
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 16 minutes. View limit details
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to
|
The filename contains "keys" and its sha256 value matches the generic-api-key rule. It is a file hash, not a secret. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuYbdEGXeMntVA9KMgtAEx
🏁 CodeAnt Quality Gate ResultsCommit: ✅ Overall Status: PASSEDQuality Gate Details
|
|
Updates to Preview Branch (claude/project-thread-sr3mdk) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
|
Updates to Preview Branch (claude/project-thread-sr3mdk) ↗︎
Tasks are run on every commit but only new migration files are pushed.
Preview Branch Database Settings ↗︎. |
There was a problem hiding this comment.
BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Codex Review SummaryThis 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. |
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
PR Summary by QodoPreserve open-shift retry keys across reloads and clear deleted posters
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
|
The fix is held for the owner's specific yes, because it edits the migration seal file. No re-run is needed: the check passes once the merge is pushed. Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cb9dadbad
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Code Review by Qodo
No findings for this group No findings for this group No findings for this group Resolved findings 1.
|
|
Auto-fix isn't included in your plan ↗ |
Auto-approval revoked — new findings require attention.
|
Code review by qodo was updated up to the latest commit 8d5fc36 |
Auto-approval revoked — new findings require attention.
Signing out and back in as the same person on one tab kept the page's in-memory post keys, so a deliberate repost could replay the earlier post. The page now clears them on the account transition, with a test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuYbdEGXeMntVA9KMgtAEx
When the signed-in account changed mid-run, the stop path returned before saving which dates had already gone live, so the same person retrying could post a duplicate. The page now records the run's results before stopping, records a request that was already answered, and names the dates that went live in the stop message. Adds a test for the mid-post switch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuYbdEGXeMntVA9KMgtAEx
|
Supabase Preview failed on ef8884a with "Failed to update config for branch". This failure isn't caused by this PR's change. That commit changes only the open-shifts page and its test, with no files under Generated by Claude Code |
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Code review by qodo was updated up to the latest commit ef8884a |
The mid-post guard compared the roster's actor ID, which only updates after the team list re-reads, so a sign-out could still let the next date send. The page now also counts sign-outs on the tab and stops on any change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuYbdEGXeMntVA9KMgtAEx
Code Review ✅ Approved 2 closed / 2 findings🔴 High risk · The roster migration backfills poster IDs and adds an account-deletion foreign key; a constraint or backfill error could block roster writes or misattribute keys. Open-shift post keys now persist in session storage across reloads, are cleared on sign-out and account change, and ✅ 2 closed✅ Bug: Migration edited after sealing: stored seal hash no longer matches
✅ Bug: Stopped post drops dates already posted in this run, so a retry re-posts them
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Approved For more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Important Your trial ends in 5 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
|
Code review by qodo was updated up to the latest commit 9755975 |
|
This PR only changes the open-shifts post page, its tests and the roster migration. It doesn't touch the services launcher or the shared Playwright settlement helper, so the failure isn't caused by this change. No fix for it exists yet. I'm re-running the failed jobs once. If it fails again, I'll treat it as a real failure. Generated by Claude Code |
User description
Summary
Before: the post key that stops a retried gap post creating a second open shift lived only in page memory. If the answer was lost and the person reloaded the page before retrying, a new key was made and a duplicate shift could still be posted. Saved post keys also kept naming a person after their account was deleted.
After: the post page keeps each date's key in session storage for up to 24 hours, so a retry after a reload sends the same key. Signing in as someone else clears the stored keys. In the database,
roster_open_post_keys.posted_bynow referencesauth.userswithon delete set null, so deleting an account clears the name from its post keys.How: new migration
20261015181500_roster_open_post_keys_posted_by_fk.sqlnulls anyposted_bywith no matching user, then adds the foreign key.schema.sql, the drift manifest and the migration seal are updated (the seal adds one new entry only). Newopen-shifts-post-keys.tshandles storage with every call guarded. The roster alerts test now checks the exact assignment read for a new post, and the SQL behaviour test proves account deletion clears the key's name.Areas touched: Personal practice, Data platform and access
RAG impact: no retrieval behaviour change, roster only.
Verification
check:migration-immutability: "312 shipped migrations unchanged".Risk and rollout
roster_open_post_keys_posted_by_fkey.Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01LuYbdEGXeMntVA9KMgtAEx
Generated by Claude Code
Summary by cubic
Keeps open-shift post keys in session storage so a retry after a reload never creates a duplicate shift, clears those keys on account change or deletion, and stops a post when the signed-in account changes mid-run.
roster_open_post_keys.posted_byreferenceauth.userswithon delete set null, matchingroster_open_shifts.posted_by; the seal hash is added to.gitleaksignoresince the filename contains "keys" and the value reads as a key.open-shifts-post-keys.tsguards all storage access so the page still works when storage is blocked.Written for commit 9755975. Summary will update on new commits.
Summary by CodeRabbit
CodeAnt-AI Description
Keep open-shift retry keys across reloads and clear them when no longer needed
What Changed
Impact
✅ Fewer duplicate open shifts after reloads✅ Safe retries after lost post responses✅ No deleted-account IDs on saved post keys💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.