Feature/notification archiving service#267
Merged
Abd-Standard merged 4 commits intoJun 25, 2026
Merged
Conversation
…l backoff - Add RetryScheduler: DB-backed scheduler that polls for PENDING notifications with retry_count > 0 and re-attempts delivery using exponential backoff - Add calculateBackoffDelay: formula = min(base * multiplier^attempt, maxDelayMs) with optional ±25% jitter to prevent thundering herd - Add next_retry_at column to scheduled_notifications schema for precise retry scheduling; index for efficient due-retry queries - Add fetchDueRetries() to ScheduledNotificationRepository: atomic UPDATE...WHERE with distributed lock (processor_id + lock_expires_at) prevents duplicate processing across concurrent instances - Update markAsFailedOrRetry() to accept and persist nextRetryAt - Add multiplier and jitter options to NotificationRetryQueue - Add RETRY_MULTIPLIER, RETRY_MAX_DELAY_MS, RETRY_JITTER, and RETRY_SCHEDULER_* env vars; expose via config - Wire RetryScheduler into service startup/shutdown in index.ts - Add unit tests (retry-scheduler.test.ts): backoff math, success path, failure path, max-retries exhaustion, duplicate prevention - Add integration tests (retry-scheduler.integration.test.ts): full SQLite round-trips covering all acceptance criteria
…oundry#242) - Add NotificationTimeline and TimelineEntry types (src/types/timeline.ts) - Add fetchTimeline() API service (src/services/timelineApi.ts) - Add NotificationTimelineView component: - Filter by notification ID input with validation - Chronologically ordered list of status transitions - Loading skeleton (3-row pulse animation) - Empty state for no-entries and pre-search states - Displays attempt number, timestamp, error message, duration - next_retry_at and lastError surfaced when relevant - Add timeline + app-tab CSS to index.css - Wire component into App.tsx via tab navigation (Event Explorer / Delivery Timeline) - Add component tests: chronological order, empty states, error handling, loading state, validation
- Extend EventFilters type with status (all/read/unread), dateFrom, dateTo - Add read? field to BlockchainEvent - Update filterEvents() to handle status and date range simultaneously - Add setStatusFilter, setDateFrom, setDateTo to Zustand store - Update useFilteredEvents hook to pass new filter params - Add NotificationSearchBar component: - Debounced text search (250 ms) to avoid unnecessary re-renders - Status filter button group (All / Unread / Read) with aria-pressed - Date range pickers (from / to) with min/max constraints - Clear all filters button (only shown when filters are active) - Fully responsive — stacks vertically on mobile via media query - Wire NotificationSearchBar into EventExplorerPage below EventFiltersBar - Reset pagination on any filter change (status, date range included) - Add component + unit tests (debounce, status, date range, clear)
…ints - Add archive-schema.sql: notification_archive table with indexes - Add archive-config.ts: ArchiveConfig type + loadArchiveConfig() via env vars (ARCHIVE_ENABLED, ARCHIVE_AFTER_MS, ARCHIVE_DELETE_AFTER_MS, etc.) - Add archive-store.ts: ArchiveStore data-access layer (insertBatch, purge, query, getById) - Add archive-service.ts: ArchiveService background worker (archive + purge cycle) - Add archive-api.ts: HTTP handler for GET /api/archive, GET /api/archive/:id, POST /api/archive/run - Wire ArchiveService + ArchiveStore into index.ts and events-server.ts - Add archive.test.ts: 21 unit/integration tests (all passing) - Add NOTIFICATION_ARCHIVING.md: schema, retention policy, API reference - Update .env.example with archive env var documentation Closes Core-Foundry#246
|
@Dami24-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Associated Issue
Closes #246
Overview
This Pull Request introduces the
Notification Archiving Servicefor theCore-Foundry/Notify-Chainbackend ecosystem. The objective is to optimize active database performance by automatically offloading historical notification records from primary storage into dedicated archive tables, while ensuring these records remain read-accessible for regulatory and compliance audits.Key Implementation Details
1. Configuration & Retention Policy
NOTIFICATION_RETENTION_DAYS,NOTIFICATION_ARCHIVE_BATCH_SIZE).2. Asynchronous Archiving Pipeline
archived_notificationstable before being purged from the activenotificationstable.3. Read-Only Retrieval Endpoints
GET /api/v1/audit/notifications/archived.Testing Strategy
Verification Steps
1. Database Check
Ensure active and archived schemas are updated:
2. API Endpoint Verification
Execute a verified GET request to fetch archived audit logs:
Checklist