Repository navigation
v2.5.7: Fix Orphaned Alarm on Schedule Edit #87 and Alarm Lifecycle Safeguards
v2.5.7: Fix Orphaned Alarm on Schedule Edit (#87) and Alarm Lifecycle Safeguards
Summary of Changes
Release v2.5.7 resolves an orphaned Android AlarmManager leak that could cause obsolete alarms to sound after modifying a medication's scheduled dose time (#87), introduces defensive filtering in MedicineAlarmReceiver to discard alarms for deleted or non-pending entries, and hardens background alarm lifecycles across Android 8 through Android 16.
📱 Patient App (Android)
- Fix Orphaned Alarm Leak on Medication Schedule Edit (#87):
- Resolved an ordering race in
MedicineRepository.updateMedicine()where obsolete untaken schedule entries were deleted from Room SQLite beforecancelAlarmsForMedicine()was invoked. - Alarms associated with old dose times (e.g. changing 08:00 to 09:00) are now explicitly cancelled in Android's
AlarmManagerwhile their schedule records still exist in the database, preventing orphaned alarm clock registrations and phantom wakeups.
- Resolved an ordering race in
- Defensive Alarm Intent Validation in
MedicineAlarmReceiver:- Added multi-entry verification ensuring that when an alarm broadcast arrives, it queries Room and validates whether any associated schedule entries are actively
PENDING. - If entries were deleted or already completed, the receiver silently discards the alarm without triggering audio playback, vibration, or notifications.
- If a grouped alarm contained multiple medications and only one was rescheduled, the receiver accurately filters and alerts only for the remaining pending medication.
- Added multi-entry verification ensuring that when an alarm broadcast arrives, it queries Room and validates whether any associated schedule entries are actively
- Schedule Edit Unit Test Coverage:
- Added
MedicineRepositoryAlarmLifecycleTestto strictly verify and enforce that alarm cancellation precedes database row deletion during schedule updates.
- Added
- Home Screen Widget Active Profile Display:
- The home screen widget header now shows the active profile name (e.g.
Dosezy • Name), making multi-profile medication monitoring clear at a glance. - Profile switching, creation, and profile name edits now trigger immediate widget refreshes.
- The home screen widget header now shows the active profile name (e.g.