Skip to content

Preserve soft-deleted comments for admin review - #348

Merged
HamptonMakes merged 7 commits into
mainfrom
hampton-preserve-soft-deleted-comments
Nov 23, 2026
Merged

HamptonMakes merged 7 commits into
mainfrom
hampton-preserve-soft-deleted-comments

Conversation

@HamptonMakes

@HamptonMakes HamptonMakes commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Deleting a comment currently overwrites its stored body. The pending scrub migration also erases text retained by earlier soft deletes. Ordinary deletion should preserve that data for administrative access.

What

  • Keep comment bodies and queued event payloads in the database after soft deletion. Public pages, notification previews, APIs, and agent event reads show deleted placeholders.
  • Add a separate admin-only permanent deletion form. It requires prior soft deletion and typed DELETE confirmation, and completes in place with progress feedback.
  • Make comment administration read-only outside permanent deletion. Keep a metadata-only audit entry identifying the admin who permanently deletes a comment.
  • Change the historical scrub migration and example-host copy to add only the comment lookup index. Preserve their existing versions.

How

Permanent deletion removes the comment, reactions, notification delivery records, queued agent events, and retained deletion-history previews. It preserves replies, the thread, and audit metadata. The service enforces admin authorization independently of the admin controller. Linked review-note comments remain protected because their review receipts are immutable; the admin page explains this restriction.

Queued events redact their response at read time, including cursor replay. Purge broadcasts retry in a background job. Failure to enqueue that job rolls back the deletion, and queued notification work skips deleted or missing comments. A named demo shows a soft-deleted opening comment beside a readable reply; reseeding preserves edits and does not recreate permanently deleted content. Served agent instructions and host migration guidance describe the retention boundary.

Risk

Hosts must replace pending copies of the earlier destructive migration before deploying this change. Text erased by an earlier release cannot be restored by this migration or by rolling back. Admin access deliberately exposes retained text; ordinary API access remains redacted even with an admin-owned token.

Testing

All 2,848 local non-browser examples and 58 selected browser examples passed. Additional focused checks cover CSRF-enabled form submission, admin audit history, and seed retention. Permanent deletion completes without a page reload. RuboCop passed across 723 files. The admin test helper now evaluates its real layout so import maps and scripts are exercised.

Generated with Codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:36:32.751258Z d78585f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HamptonMakes
HamptonMakes merged commit 0608dee into main Nov 23, 2026
15 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