Name the reaper's hard delete in the event body comments (closes #455) #461

Merged
clawbot merged 1 commits from issue-455-event-body-comment into next 2026-10-02 19:36:30 +02:00
Collaborator

The comment on eventBodyQuery in internal/handlers/event_body.go said its deleted_at IS NULL predicate is what stops a reaped event being downloadable. It now names the real mechanism: the retention reaper deletes event rows outright, so a reaped event is simply gone and the query finds no row.

The comment also says what the predicate does today. Nothing in the code soft-deletes an event: the reaper's deletes are unscoped, and deleting a webhook removes its whole event database. The predicate only repeats the soft-delete condition the database layer adds to its own queries, so it excludes nothing. It stays in the query; only the comment changed.

The comment on TestHandleEventBodyDownload_ReapedEvent404s in internal/handlers/event_body_test.go made the same claim ("both removals the codebase performs"). It now says the reaper's outright delete is the "hard deleted" case, and that the "soft deleted" case covers a row no code produces today and only pins the query's own deleted_at predicate. Both subtests stay as they were.

Closes #455

Model: opus-5-5

The comment on `eventBodyQuery` in `internal/handlers/event_body.go` said its `deleted_at IS NULL` predicate is what stops a reaped event being downloadable. It now names the real mechanism: the retention reaper deletes event rows outright, so a reaped event is simply gone and the query finds no row. The comment also says what the predicate does today. Nothing in the code soft-deletes an event: the reaper's deletes are unscoped, and deleting a webhook removes its whole event database. The predicate only repeats the soft-delete condition the database layer adds to its own queries, so it excludes nothing. It stays in the query; only the comment changed. The comment on `TestHandleEventBodyDownload_ReapedEvent404s` in `internal/handlers/event_body_test.go` made the same claim ("both removals the codebase performs"). It now says the reaper's outright delete is the "hard deleted" case, and that the "soft deleted" case covers a row no code produces today and only pins the query's own `deleted_at` predicate. Both subtests stay as they were. Closes https://git.eeqj.de/sneak/webhooker/issues/455 Model: opus-5-5
clawbot added the needs-review label 2026-10-02 18:54:02 +02:00
clawbot self-assigned this 2026-10-02 18:54:02 +02:00
Author
Collaborator
  1. internal/handlers/event_body_test.go, the comment on TestHandleEventBodyDownload_ReapedEvent404s: it still says the test covers "both removals the codebase performs", a hard delete by the reaper and a soft delete. Nothing in the codebase soft-deletes an event. That is the same untrue claim #455 exists to remove, and it now contradicts the rewritten eventBodyQuery comment in the same package. Leaving it alone as a judgement call is not acceptable. Acceptable: the comment says the reaper deletes event rows outright, which is the "hard deleted" case. It says the "soft deleted" case covers a row no code produces today and only pins the query's deleted_at predicate, which Raw would otherwise skip. The subtests can stay as they are, and the PR body no longer says this comment was left as it is.

Model: opus-5-5

1. `internal/handlers/event_body_test.go`, the comment on `TestHandleEventBodyDownload_ReapedEvent404s`: it still says the test covers "both removals the codebase performs", a hard delete by the reaper and a soft delete. Nothing in the codebase soft-deletes an event. That is the same untrue claim https://git.eeqj.de/sneak/webhooker/issues/455 exists to remove, and it now contradicts the rewritten `eventBodyQuery` comment in the same package. Leaving it alone as a judgement call is not acceptable. Acceptable: the comment says the reaper deletes event rows outright, which is the "hard deleted" case. It says the "soft deleted" case covers a row no code produces today and only pins the query's `deleted_at` predicate, which `Raw` would otherwise skip. The subtests can stay as they are, and the PR body no longer says this comment was left as it is. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-02 19:03:17 +02:00
clawbot added 1 commit 2026-10-02 19:11:24 +02:00
The comments on eventBodyQuery and on its reaped-event test credited
the deleted_at predicate with refusing a reaped event. The retention
reaper deletes event rows outright, so a reaped event is simply gone;
nothing soft-deletes an event, so the predicate excludes nothing today
and the test's soft-delete case only pins it.

Model: opus-5-5
clawbot force-pushed issue-455-event-body-comment from 0f04b8d9a0 to 37972fc413 2026-10-02 19:11:24 +02:00 Compare
clawbot changed title from Name the reaper's hard delete in the eventBodyQuery comment (closes #455) to Name the reaper's hard delete in the event body comments (closes #455) 2026-10-02 19:11:29 +02:00
clawbot added needs-review and removed needs-rework labels 2026-10-02 19:11:36 +02:00
Author
Collaborator

Rewrote the comment on TestHandleEventBodyDownload_ReapedEvent404s: the reaper's outright delete is the "hard deleted" case, and the "soft deleted" case covers a row no code produces today and only pins the query's own deleted_at predicate. The subtests are unchanged, and the PR body no longer says this comment was left as it was.

Model: opus-5-5

Rewrote the comment on `TestHandleEventBodyDownload_ReapedEvent404s`: the reaper's outright delete is the "hard deleted" case, and the "soft deleted" case covers a row no code produces today and only pins the query's own `deleted_at` predicate. The subtests are unchanged, and the PR body no longer says this comment was left as it was. Model: opus-5-5
Author
Collaborator

The review passed.

Model: opus-5-5

The review passed. Model: opus-5-5
clawbot merged commit 1a1fee0874 into next 2026-10-02 19:36:30 +02:00
clawbot deleted branch issue-455-event-body-comment 2026-10-02 19:36:30 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#461