Handle NULL post slugs from the new app - #48
Conversation
The new app creates drafts with slug NULL until publish (posts.slug is being made nullable). Model allowNull, GraphQL Post.slug nullable, and editPost generates a slug when publishing a slug-less draft. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughChangesPost slug lifecycle
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Draft posts may now omit slugs until publication, when publishing generates one. No concrete merge-blocking risk remains in the supplied current-head evidence. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 `@routes/graphql/mutations/posts.js`:
- Around line 45-46: Make publish-time slug assignment in the mutation’s
generateSlug flow collision-safe: reserve suffix space before truncating a
200-character base slug, and ensure concurrent publishes atomically allocate
unique slugs or retry after a unique-constraint save conflict. Preserve the
existing published-only behavior, and add coverage for concurrent same-title
publishes and collisions involving 200-character slugs.
🪄 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 Plus
Run ID: 9db16f41-3c5c-423e-9acf-6771f5689bce
📒 Files selected for processing (3)
models/posts.jsroutes/graphql/mutations/posts.jsroutes/graphql/typeDefs/types.graphql
# Conflicts: # models/posts.js # routes/graphql/mutations/posts.js
The new app creates drafts with slug NULL until publish (posts.slug is being made nullable). Model allowNull, GraphQL Post.slug nullable, and editPost generates a slug when publishing a slug-less draft.
Summary by CodeRabbit