RetentionDays cannot be set to 0 (retain forever) via the normal create path #79

Open
opened 2026-08-07 15:26:51 +02:00 by clawbot · 2 comments
Collaborator

Surfaced during #63 / PR #78.

Webhook.RetentionDays carries gorm:"default:30", so GORM substitutes the column default (30) for a zero value on Create. The retention reaper correctly treats a RetentionDays of 0 or less as "retain forever", but that value is unreachable through the normal create path: a webhook created without an explicit positive value gets 30, and there is no way to express "keep forever" from the create/edit flow.

Net effect today: every webhook has an effective minimum retention (default 30 days) and cannot be set to keep events indefinitely.

Definition of done:

  • a user can configure a webhook to retain events forever (options: a distinct sentinel value, a nullable column, or an explicit "never expire" affordance that persists a non-positive value past the GORM default)
  • the reaper's retain-forever branch is reachable end to end from a normal create/edit
  • covered by a test

Note: this ties into the web-UI cleanup (#57) — whether and how retention is surfaced in the UI.

Surfaced during #63 / PR #78. `Webhook.RetentionDays` carries `gorm:"default:30"`, so GORM substitutes the column default (30) for a zero value on `Create`. The retention reaper correctly treats a `RetentionDays` of 0 or less as "retain forever", but that value is unreachable through the normal create path: a webhook created without an explicit positive value gets 30, and there is no way to express "keep forever" from the create/edit flow. Net effect today: every webhook has an effective minimum retention (default 30 days) and cannot be set to keep events indefinitely. Definition of done: - a user can configure a webhook to retain events forever (options: a distinct sentinel value, a nullable column, or an explicit "never expire" affordance that persists a non-positive value past the GORM default) - the reaper's retain-forever branch is reachable end to end from a normal create/edit - covered by a test Note: this ties into the web-UI cleanup (#57) — whether and how retention is surfaced in the UI.
Owner

let's use 365*1000 days as the retain-forever value.

let's use 365*1000 days as the retain-forever value.
Owner

attempting to set retentiondays to 0 should rewrite this on insert/update to be the 365*1000 value in the db

attempting to set retentiondays to 0 should rewrite this on insert/update to be the 365*1000 value in the db
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#79