You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Backend] notificationService cleanup interval lacks a try/catch around its async callback #15
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
Hi, maintainers 👋.
I’d like to work on this issue.
I’m a full-stack developer and smart contract expert; I have previously contributed to multiple open-source projects.
Happy to take this. The root of it is that setInterval doesn't await its callback, so an async cleanup callback that throws has nowhere for its rejection to land, which is the unhandled rejection. I'd fix it the way defaultChecker and scoreReconciliation already do: wrap the body in a void-IIFE with a try/catch inside, awaiting deleteOldNotifications and deleteReadAndArchived in the try and logging any failure via winston in the catch. Because the catch sits inside the per-run IIFE, a single failed run is logged and swallowed while the interval keeps firing, so future runs aren't affected.
I'd match the existing scheduler pattern rather than introduce a new one, and add a test that forces a throw in cleanup and asserts it's caught and logged. I'll stay in scope, so no retention-default or metrics changes. I'll also claim it in the Telegram group as the issue asks. Please assign this to me.
I came across your project and I’m really interested in contributing.
I have experience with React for building responsive, user-friendly interfaces, and I’m also familiar with smart contracts and blockchain basics. I focus on writing clean, scalable code and improving user experience.
I’m a fast learner and ready to get started immediately. Please let me know the next steps.
Activity
Amarjeet325 commentedon Jun 19, 2026
Hi, maintainers 👋.
I’d like to work on this issue.
I’m a full-stack developer and smart contract expert; I have previously contributed to multiple open-source projects.
Could you please assign this issue to me?
Delightech28 commentedon Jun 20, 2026
I'd like to work on this
ogazboiz commentedon Jun 21, 2026
Happy to take this. The root of it is that setInterval doesn't await its callback, so an async cleanup callback that throws has nowhere for its rejection to land, which is the unhandled rejection. I'd fix it the way defaultChecker and scoreReconciliation already do: wrap the body in a void-IIFE with a try/catch inside, awaiting deleteOldNotifications and deleteReadAndArchived in the try and logging any failure via winston in the catch. Because the catch sits inside the per-run IIFE, a single failed run is logged and swallowed while the interval keeps firing, so future runs aren't affected.
I'd match the existing scheduler pattern rather than introduce a new one, and add a test that forces a throw in cleanup and asserts it's caught and logged. I'll stay in scope, so no retention-default or metrics changes. I'll also claim it in the Telegram group as the issue asks. Please assign this to me.
Johnpii1 commentedon Jun 21, 2026
Hello Sir,
I came across your project and I’m really interested in contributing.
I have experience with React for building responsive, user-friendly interfaces, and I’m also familiar with smart contracts and blockchain basics. I focus on writing clean, scalable code and improving user experience.
I’m a fast learner and ready to get started immediately. Please let me know the next steps.
Thank you.
Best regards,
Johnpaul
grantfox-oss commentedon Jun 21, 2026
🦊 GrantFox — @Johnpii1 has been assigned to this issue as part of the Official Campaign campaign!
Next steps:
Closes #15)Good luck! Track your progress on GrantFox.
grantfox-oss commentedon Jun 29, 2026
🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign campaign!
@Johnpii1's PR #40 was approved and merged by @ogazboiz.
🏆 @Johnpii1: You earned 35 FoxPoints for this contribution! Your current tier: Builder (1,031 total points). Track your full progress on GrantFox.
👏 Great work, @Johnpii1! Keep contributing to LabsCrypt.