mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 02:12:26 +00:00
Deleted comments previously persisted (no kind-5 handling; the thread cache only merged-in). The thread service now processes NIP-09 deletion requests: - A kind-5 event removes a target comment only when it is signed by that comment's own author (you cannot delete someone else's comment). The author match is the security boundary. - Deletions are remembered per target, so a comment that arrives after its author's deletion (out-of-order relays) is suppressed on insert. - On load, after fetching the thread, deletions for the loaded comment ids are fetched (kind 5, #e: ids) and applied before the thread is rendered, so the cache can't resurrect a deleted comment. Removal re-renders the thread. - Replies to a removed comment become unreachable from the root and are hidden with their deleted parent. `fetchDeletionEvents` is injectable; the default queries the relay pool. Live deletions mid-session aren't subscribed yet (a kind-5 can't be scoped by the video upfront) — deletions are honored on each thread open. Tests: author-signed deletion removes the comment; a non-author deletion is ignored; an out-of-order deletion suppresses the later comment. Both the author-match and the suppress-on-insert guard are mutation-verified. Co-Authored-By: Claude Opus 4.8 <[email protected]>