Skip to content

fix(posts): require an author to publish - #65

Open
rafalyovson wants to merge 1 commit into
mainfrom
fix/post-authors-required
Open

rafalyovson wants to merge 1 commit into
mainfrom
fix/post-authors-required

Conversation

@rafalyovson

Copy link
Copy Markdown
Member

Why

Post 16 (Siri + Gemini) lost its authors and topics relationships in a burst of saves on 2026-01-22 and stayed published for ten months. Its JSON-LD author fell back to "Lyóvson Team", and it was missing from /rafa and /topics/tech. Rafa asked for authors to be required. Task: https://app.notion.com/p/41da881304bb81e791cfe98e68941b37

Change

required: true on posts.authors, plus regenerated payload-types.ts and a test fixture that now needs authors.

  • Payload validates required fields only when publishing, so drafts may still have no author.
  • authors is a hasMany relationship stored in posts_rels, so no column or migration changes.

Checks

  • tsc --noEmit, pnpm lint, pnpm test, pnpm seo:check and a production build (preview:experience:build) all pass.
  • A Payload Local API script against a Neon dev branch copied from production:
    • Publishing post 16 without authors is rejected with "The following field is invalid: Authors".
    • A draft save without authors succeeds.
    • Publishing with authors [1] and topics [4, 5] succeeds: Rafa Lyóvson; Tech and Business.

Review

Independent reviewer agent (Opus) on 4f0ec29..0134bfb: no findings. It confirmed:

  • Payload skips validation only for non-published draft saves.
  • The Postgres adapter adds no constraint for a required hasMany relationship.
  • Every post-writing path still supplies authors or bypasses field validation: the seed script, embedding writes, trash.

Note: post 16 itself is still unfixed in production. Restoring it is a separate production write.

REVIEW: PASS 0134bfb

🤖 Generated with Claude Code

Post 16 (Siri + Gemini) lost its authors and topics in a burst of saves
on 2026-01-22 and stayed published for ten months with the JSON-LD
author falling back to "Lyóvson Team". Payload now rejects publishing
a post without an author; drafts may still leave it empty. Authors are
a hasMany relationship stored in posts_rels, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lyovsoncom Ready Ready Preview Nov 19, 2026 9:45pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 0134bfb0 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant