Skip to content

refactor: idempotent AlertStore + simplify DeliveryAttempt#804

Merged
alexluong merged 2 commits intomainfrom
alex/idempotent-alert-store
Apr 3, 2026
Merged

refactor: idempotent AlertStore + simplify DeliveryAttempt#804
alexluong merged 2 commits intomainfrom
alex/idempotent-alert-store

Conversation

@alexluong
Copy link
Copy Markdown
Collaborator

@alexluong alexluong commented Apr 3, 2026

Summary

  • Idempotent failure counting: Replace INCR/GET with SADD/SCARD on a Redis Set keyed by attemptID — replayed messages are a no-op
  • Simplify DeliveryAttempt: Use models.Attempt + models.Event directly instead of Success bool, *DeliveryTask, DeliveryResponse, Timestamp — eliminates manual error extraction in messagehandler

No alert payload schema changes. Redis key scheme changes from {dp}:alert:{dest}:consecutive_failures to {dp}:alert:{dest}:cf — old keys expire within 24h, no migration needed.

Test plan

  • Store idempotency test: same attemptID twice → count stays at 1
  • Monitor unit tests pass with unique attempt IDs
  • Messagehandler unit tests updated
  • E2E alert tests pass (make test/e2e)

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
outpost-docs Ready Ready Preview, Comment Apr 3, 2026 0:19am
outpost-website Ready Ready Preview, Comment Apr 3, 2026 0:19am

Request Review

alexluong and others added 2 commits April 3, 2026 19:18
Replace INCR/GET with SADD/SCARD on a Redis Set keyed by attemptID.
Replayed messages no longer double-count consecutive failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace DeliveryAttempt fields (Success, DeliveryTask, DeliveryResponse,
Timestamp) with models.Attempt and models.Event. Success is derived from
Attempt.Status, delivery response from Attempt.ResponseData. Simplifies
messagehandler by removing manual error extraction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexluong alexluong force-pushed the alex/idempotent-alert-store branch from 23c5010 to e5e3b51 Compare April 3, 2026 12:18
@alexluong alexluong changed the title refactor: idempotent AlertStore using Redis Sets refactor: idempotent AlertStore + simplify DeliveryAttempt Apr 3, 2026
@alexluong alexluong merged commit c174e3c into main Apr 3, 2026
5 checks passed
@alexluong alexluong deleted the alex/idempotent-alert-store branch April 3, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants