Skip to content

feat(listener): add notification retry queue with exponential backoff - #54

Merged
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Mrwicks00:feature/notification-retry-queue
Jun 18, 2026
Merged

feat(listener): add notification retry queue with exponential backoff#54
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Mrwicks00:feature/notification-retry-queue

Conversation

@Mrwicks00

Copy link
Copy Markdown
Contributor

PR: feat(listener): Add notification retry queue with exponential backoff

Branch: feature/notification-retry-queuemain
Closes #25


Summary

  • New NotificationRetryQueue service (listener/src/services/notification-retry-queue.ts) — manages a queue of failed Discord notifications, processes due items on a configurable interval, retries them with exponential backoff, and permanently marks notifications as failed after the max retry limit is reached.
  • Integrated into EventSubscriber — when discordService.sendEventNotification() returns false, the event is enqueued for retry instead of silently dropped.
  • Configurable via env vars  RETRY_BASE_DELAY_MS (default 5000) and RETRY_MAX_RETRIES (default 5).
  • 11 new tests covering enqueue, retry timing, exponential backoff delays, max-retry cutoff, and start/stop behaviour.
  • Fixed pre-existing syntax error in discord-notification.ts — a malformed logger.info call with a missing closing brace.

Retry behaviour

Attempt | Delay from previous failure -- | -- 1 | baseDelayMs × 2⁰ = 5s 2 | baseDelayMs × 2¹ = 10s 3 | baseDelayMs × 2² = 20s … | … max | logged as permanently failed

Test plan

  •  npm test — 88/88 tests pass across all suites
  •  Exponential backoff verified with fake timers (incremental advance + promise flush)
  •  Max-retry cutoff removes item from queue and logs error
  •  Start/stop idempotency verified
  •  No regressions in event-subscriber, discord-notification, or other existing suites


Implements a retry queue for failed Discord notifications to improve
reliability during temporary network failures. Failed notifications are
automatically retried with exponential backoff (base * 2^attempt) and
dropped after a configurable max retry limit with an error log.

Fixes syntax error in discord-notification.ts (malformed logger call).
Configurable via RETRY_BASE_DELAY_MS and RETRY_MAX_RETRIES env vars.
@Abd-Standard
Abd-Standard merged commit 2b5a027 into Core-Foundry:main Jun 18, 2026
0 of 2 checks passed
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.

Add Notification Retry Queue

2 participants