fix(slots): reconcile pinned flag on existing default-label slots#959
fix(slots): reconcile pinned flag on existing default-label slots#959shgew wants to merge 2 commits into
Conversation
seedDefaults (the slots default-label seeder) now reconciles the pinned flag on existing default-label slots to match the current template, while preserving user content. Pre-fix: default slots seeded before the current pinned=true defaults kept pinned=false forever and never reached SessionStart injection. Idempotent; user-written content untouched. Tests: test/slots.test.ts (+55 lines, 6 new cases). Signed-off-by: Hleb Shauchenka <me@marleb.org>
|
@shgew is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesPinned flag sync in seedDefaults
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/functions/slots.ts`:
- Around line 162-168: The kv.set operation that updates the pinned property
when existing.pinned differs from tmpl.pinned is missing audit logging, making
this reconciliation invisible to audit history. Add a recordAudit() call
immediately after the kv.set invocation to log this state-changing operation,
ensuring the audit trail captures when pinned state is reconciled. Reference the
updated template data and operation type in the audit record to maintain
consistency with other state-changing operations in the codebase.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9dc727ac-8f1b-43b9-8ffb-d0c852d570fd
📒 Files selected for processing (2)
src/functions/slots.tstest/slots.test.ts
seedDefaults now records a slot_seed_reconcile audit entry when it rewrites an existing default-label slot to flip its pinned flag, matching the project rule that every state-changing kv.set has an audit trail.
What
seedDefaults(the slots default-label seeder) now reconciles thepinnedflag on existing default-label slots to match the current template, while preserving user content.Why
Pre-fix: default slots seeded before the current
pinned: truedefaults keptpinned: falseforever and never reached SessionStart injection. The seeder only ran on missing slots, so existing slots stayed stale across version bumps.Tests
test/slots.test.tsextended (2 new cases): re-pins a default-label slot stored withpinned: falsewhile preserving content; leaves a non-default custom slot untouched. Targeted suite: 16/16 pass.Compatibility
Idempotent. User-written content on default-label slots is preserved; only the
pinnedflag is reconciled. Custom (non-default-label) slots are not touched.Summary by CodeRabbit