Prevent Duplicate Medication Reminders on Server Restart #52
Closed
SrishtiSonam
started this conversation in
Ideas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Currently, medication reminders can be triggered multiple times when:
This happens because reminder scheduling relies on in-memory state, which is lost on restart. When the app rehydrates data, the same reminders may be scheduled again, leading to duplicate notifications. In a healthcare context, this is risky and can negatively impact patient safety.
Proposed Idea / Solution
Introduce idempotent reminder scheduling with both in-memory and database-level safeguards.
Key Concepts
Deterministic Reminder Identity
Persistent Deduplication (DB-level)
lastReminderSentAtSafe Rehydration on Server Restart
Why This Matters
Scope
Files Likely Affected
server/src/models/Medication.jsserver/src/services/schedulerService.jsserver/src/index.jsserver/test/scheduler.test.jsOpen Questions
I’m happy to take this up and submit a PR if the approach aligns with the maintainers’ direction.
All reactions