Skip to content

[Backend] notificationService cleanup interval lacks a try/catch around its async callback #15

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

In src/services/notificationService.ts the cleanup setInterval awaits deleteOldNotifications and deleteReadAndArchived with no surrounding try/catch (unlike defaultChecker and scoreReconciliation), so a failing query produces an unhandled promise rejection.

Acceptance criteria

  • Wrap the cleanup callback body in try/catch and log failures via winston
  • Ensure a single failed cleanup run does not stop future runs
  • Follow the void-IIFE pattern used by the other schedulers
  • Add a test that a thrown error in cleanup is caught and logged

Files to touch

  • src/services/notificationService.ts

Out of scope

  • Changing retention defaults
  • Cleanup metrics dashboard

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions