Skip to content

Comments: edit and delete your own, on the web and over MCP - #59

Merged
vijayakrishnans merged 3 commits into
mainfrom
fix/own-comments
Dec 3, 2026
Merged

vijayakrishnans merged 3 commits into
mainfrom
fix/own-comments

Conversation

@vijayakrishnans

Copy link
Copy Markdown
Collaborator

Nobody could edit or delete their own comments. This adds both.

Core — GET/PUT/DELETE /me/posts/{id} (under /me, so the gateway forwards it with no new route). Each repository statement has author_subject_id = $1 in its WHERE, so somebody else's comment is a 404, never a 403. An edit moves edited_at (the page already says "edited"), and is refused in a locked or removed thread. A delete keeps the row as removed, so replies under it still read, and overwrites the body.

Overlay — new myPosts: the subset of the post ids the page asked about that the visitor wrote. Bounded exactly like postVotes; the public post still never carries an author id, and anonymous and signed-in documents stay byte-identical.

Web — OwnComment draws Edit and Delete after paint on your own comments in all three comment views (product Talk, /threads/{id}, product post threads). Edit reads the comment back as typed; Delete asks first. Calls go through a JSON-only /me/own-comment route that reads the session server-side.

MCP — edit_my_comment (no body: read back; body: rewrite) and delete_my_comment (destructive hint). Parity catalogue updated.

Tests — real-Postgres tests for the four statements (yours vs someone else's, locked thread, delete keeps the row and drops the words); the thread-privacy scan classifies them; core handler tests; overlay shape tests; a web test for the control and route.

🤖 Generated with Claude Code

- core: GET/PUT/DELETE /me/posts/{id}, scoped by author in the repository's
  own SQL (a comment somebody else wrote is a 404). An edit moves
  edited_at, so every view says "edited"; it is refused in a locked or
  removed thread. A delete keeps the row as removed (replies still read)
  and overwrites the words.
- overlay: `myPosts`, the subset of the page's comment ids the visitor
  wrote, bounded like `postVotes`.
- web: OwnComment draws Edit and Delete after paint on your own comments
  only (product Talk, thread pages, product post threads), through a
  JSON-only /me/own-comment route that reads the session server-side.
- MCP: edit_my_comment (read back or rewrite) and delete_my_comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vijayakrishnans and others added 2 commits December 3, 2026 18:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured in CI: the tabs 182,996 B, Talk 187,204, the post's page
188,821. Each limit moves to the measurement plus ~100 B.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vijayakrishnans
vijayakrishnans merged commit 7d5a19d into main Dec 3, 2026
19 checks passed
@vijayakrishnans
vijayakrishnans deleted the fix/own-comments branch December 3, 2026 11:40
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