Fix duplicate alarm bug where updating schedule time created multiple schedules in database, violating "one notification per day" contract. Plugin Changes: - Use stable scheduleId "daily_notification" instead of timestamp-based IDs - Delete all existing notification schedules before creating new one - Cancel alarms in AlarmManager before database deletion - Add detailed logging for cleanup operations - Make scheduleDailyReminder delegate to scheduleDailyNotification Test Harness Changes: - Make TEST 2 fail when alarm count > 1 after schedule update - Make TEST 2 fail when alarm count > 1 after recovery - Add clear failure messages explaining "one per day" violation - Add final verdict section with detailed failure summary Results: - Before: 2-3 alarms, 2 schedules in DB, "Pending: 2" in UI - After: 1 alarm, 1 schedule in DB, "Pending: 1" in UI - TEST 2 now correctly passes with proper validation This ensures that updating schedule time maintains exactly one alarm per day, preventing duplicate notifications and database bloat.
45 KiB
Executable File
45 KiB
Executable File