fix(alerting/I-1): retry endpoint resets attempts to 0 instead of incrementing

AlertNotificationRepository gains resetForRetry(UUID, Instant) which sets
attempts=0, status=PENDING, next_attempt_at=now, and clears claim/response
fields. AlertNotificationController calls resetForRetry instead of
scheduleRetry so a manual retry always starts from a clean slate.

AlertNotificationControllerIT adds retryResetsAttemptsToZero to verify
attempts==0 and status==PENDING after three prior markFailed calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-20 08:25:59 +02:00
parent d74079da63
commit 424894a3e2
4 changed files with 47 additions and 4 deletions

View File

@@ -13,5 +13,7 @@ public interface AlertNotificationRepository {
void markDelivered(UUID id, int status, String snippet, Instant when);
void scheduleRetry(UUID id, Instant nextAttemptAt, int status, String snippet);
void markFailed(UUID id, int status, String snippet);
/** Resets a FAILED notification for operator-triggered retry: attempts → 0, status → PENDING. */
void resetForRetry(UUID id, Instant nextAttemptAt);
void deleteSettledBefore(Instant cutoff);
}