Skip to content

fix(listener): resolve notification count mismatch and optimize stale…#167

Merged
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
femiolutayo:Resolve-Notification
Jun 23, 2026
Merged

fix(listener): resolve notification count mismatch and optimize stale…#167
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
femiolutayo:Resolve-Notification

Conversation

@femiolutayo

Copy link
Copy Markdown

closes #135

I have successfully resolved the notification count mismatch bug. Here is a summary of the accomplishments:

Updated Statistics Calculation: In

scheduled-notification-repository.ts
, updated the SQL queries in getStats() to dynamically classify stale PROCESSING notifications (with expired locks) as pending (and overdue if past execution time) instead of processing.
Updated Stale Lock Recovery: In

scheduled-notification-repository.ts
, modified recoverStaleLocks() to run within a transaction, increment the retry_count for each recovered notification, mark notifications as FAILED once max_retries is reached, and log each recovery attempt to notification_execution_log.
Added Unit Tests: Added three comprehensive tests in

notification-scheduler-refactored.test.ts
to verify retry count incrementation, max-retries limit enforcement on recovery, and statistics count accuracy when stale locks are present.

@Abd-Standard Abd-Standard merged commit ee0b34e into Core-Foundry:main Jun 23, 2026
2 of 3 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.

[Bug] Resolve Notification Count Mismatch

2 participants