Skip to content

fix(moderation): only notify staff about pending posts/comments; notify everyone else on approval - #1762

Merged
mattwoberts merged 1 commit into
mainfrom
fix/moderation-pending-notifications
Nov 5, 2026
Merged

mattwoberts merged 1 commit into
mainfrom
fix/moderation-pending-notifications

Conversation

@mattwoberts

Copy link
Copy Markdown
Contributor

With content moderation enabled, posts and comments awaiting approval sent the usual new post / new comment / mention notifications (and webhooks) to everyone subscribed, as if they were already published.

Changes

  • Pending content: only admins and collaborators (who can see it and need to moderate it) get the new post / new comment / mention notifications. Webhooks are held back.
  • On approval: everyone else gets the notifications that were held back, and the webhook fires. Staff are not notified twice; mentions are de-duplicated by the existing mention log. The email sender is the post/comment author, not the approving admin.
  • Comments on a still-pending post (including staff comments) stay staff-only.
  • Approving an item that is already approved is a no-op (UPDATE ... AND is_approved = false), so repeated approvals don't re-send notifications.
  • Editing a comment now passes the comment's approval state to the mention task (it was previously always unset).

Testing

  • New task tests: pending post → staff only, no webhook; approved post → non-staff only, webhook fires, author as sender; pending comment with a mention → staff only.
  • New storage test: approve post/comment reports a change only the first time.
  • Existing notification test fixtures updated to mark posts/comments as approved and set the author.
  • golangci-lint clean, go test ./... passing.

🤖 Generated with Claude Code

…fy everyone else on approval

Pending posts and comments now only send new post/comment/mention
notifications to admins and collaborators. Everyone else is notified
when the item is approved, and webhooks fire then. Approving an item
that is already approved is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattwoberts
mattwoberts added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 3d73603 Nov 5, 2026
5 checks passed
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