Deleting a target blanks its name on every historical delivery in the event log #211

Open
opened 2026-08-20 05:48:49 +02:00 by clawbot · 0 comments
Collaborator

Deletes are soft (internal/database/base_model.go:16, deleteChildResource at internal/handlers/source_management.go:1295-1298) and deliveries carry no FK to the target row, so deleting a target correctly preserves all its delivery history — verified, the rows survive intact.

But loadTargetMap (source_management.go:800-820) queries under GORM's default scope, so the soft-deleted target is excluded and targetMap[TargetID] yields a zero TargetView. templates/source_logs.html:26-30 then renders {{.Target.Name}}: {{.Status}} as:

: failed

Verified before and after: the target name disappeared from the log page while its delivery rows remained. The history survives; its label does not.

This is the practical cost of having no target edit form (#127) — changing a destination URL means delete and recreate, and that silently unlabels everything the old target ever did.

Definition of done:

  • loadTargetMap includes soft-deleted targets (Unscoped(), or a dedicated lookup) so historical deliveries keep their name
  • a deleted target's name renders with a marker making clear it no longer exists, e.g. echo-sink (deleted)
  • masking rules for target config are unchanged by this — a deleted target's config stays masked
  • a handler test asserts a delivery produced by a since-deleted target still renders its name

Not milestoned to 1.0.0: it is a display defect on an already-degraded path, and #127 plus the replay work may reshape it.

Deletes are soft (`internal/database/base_model.go:16`, `deleteChildResource` at `internal/handlers/source_management.go:1295-1298`) and deliveries carry no FK to the target row, so deleting a target correctly preserves all its delivery history — verified, the rows survive intact. But `loadTargetMap` (`source_management.go:800-820`) queries under GORM's default scope, so the soft-deleted target is excluded and `targetMap[TargetID]` yields a zero `TargetView`. `templates/source_logs.html:26-30` then renders `{{.Target.Name}}: {{.Status}}` as: ``` : failed ``` Verified before and after: the target name disappeared from the log page while its delivery rows remained. The history survives; its label does not. This is the practical cost of having no target edit form (#127) — changing a destination URL means delete and recreate, and that silently unlabels everything the old target ever did. Definition of done: - `loadTargetMap` includes soft-deleted targets (`Unscoped()`, or a dedicated lookup) so historical deliveries keep their name - a deleted target's name renders with a marker making clear it no longer exists, e.g. `echo-sink (deleted)` - masking rules for target config are unchanged by this — a deleted target's config stays masked - a handler test asserts a delivery produced by a since-deleted target still renders its name Not milestoned to 1.0.0: it is a display defect on an already-degraded path, and #127 plus the replay work may reshape it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#211