max_retries is unbounded at target creation, and unparseable input silently becomes 0 #221
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while implementing #202, with a second defect added from its review.
Two problems in the same helper,
parseNonNegativeInt(internal/handlers/source_management.go:1183-1194), whichHandleTargetCreateuses formax_retries:1. No ceiling. Any non-negative value is accepted.
parseRetentionDaysin the same file shows the intended shape: validate against a stated ceiling and answer 400 naming it. A typo'd extra zero givesMaxRetriesof 100000 and the engine will genuinely record that manydelivery_resultsrows, each of which the event log then loads and renders.2. Unparseable input silently returns 0. This is the silent-fallback pattern the owner rejected on #78 — a set-but-invalid value must fail loudly, never degrade into a default the operator did not ask for. Here a garbage
max_retriesquietly means "never retry", which is the opposite of what someone typing a number into that field intends, and nothing tells them.It is operator-chosen rather than sender-chosen, so it is a robustness bug rather than a 1.0 blocker — an operator can only shoot themselves.
Definition of done:
max_retriesis validated at creation and edit against a stated ceiling, rejected with 400 naming the ceilingparseNonNegativeIntfor the same coercion and fix or justify eachmax_retries is unbounded at target creation, so one target can queue arbitrarily many delivery attemptsto max_retries is unbounded at target creation, and unparseable input silently becomes 0