1
0
mirror of https://github.com/avinal/nikki.git synced 2026-07-03 21:40:09 +05:30

Fix 5 notification reliability issues

1. Remove println debug statement from ReminderScheduler

2. Drop scheduledIds tracking — AlarmManager deduplicates via
   FLAG_UPDATE_CURRENT, and the tracking prevented rescheduling
   when a task's due time was edited

3. TaskCheckWorker uses live app DB via liveMemosProvider when
   available, falls back to opening its own DB only when the
   app process isn't running (boot receiver, background check)

4. Default notify time synced from DataStore to SharedPreferences
   via syncNotifyTime() — both DirectAlarmScheduler and
   TaskCheckWorker now read from the same source via
   readDefaultNotifyTime() helper

5. TaskReminderReceiver triggers runTaskCheckNow() after each
   alarm fires, so the next alarm is scheduled immediately
   instead of waiting up to 15 min for WorkManager

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context)
This commit is contained in:
2026-06-01 15:24:43 +05:30
parent ef34738591
commit ad536d1e3d
10 changed files with 55 additions and 47 deletions
@@ -4,6 +4,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.avinal.memos.notifications.TaskNotificationManager
import com.avinal.memos.notifications.runTaskCheckNow
class TaskReminderReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
@@ -19,5 +20,6 @@ class TaskReminderReceiver : BroadcastReceiver() {
dueLabel = dueLabel,
priority = priority,
)
runTaskCheckNow(context)
}
}