Skip to content

Robustness: webhook rate limiter records a delivery before it succeeds #62

Description

@LarsLaskowski

Source: Full code review 2026-07-17 (docs/reviews/2026-07-17-full-code-review.md), finding F5.
Category: robustness · Severity: low · Effort: small

Problem

rateLimited (internal/alert/notify.go:199-209) stamps lastSent[key] = ev.At at check time, before deliver runs. If that delivery then fails all retries, the next firing of the same metric within notify_min_interval_seconds is still suppressed as a "repeat" — even though nothing was ever delivered.

Suggested fix

Stamp lastSent only after a successful post (or clear the stamp when deliver gives up), so the limiter counts deliveries, not attempts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions