Worker failures are indistinguishable from "nothing to say", and an answered reminder stays in the shade #73
Labels
No Label
P0
P1
P2
release-blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Privacy-Period-Tracker#73
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What is true now.
ReminderWorker.doWork(core/notifications/.../ReminderWorker.kt:58-68) catches everyExceptionand returnsResult.success().Result.retry()appears nowhere in the repository and no backoff is configured. A repository that throws every day produces no reminders, no logs, no metric, and nothing a user or a developer could tell apart from a quiet cycle.catch (Exception)also letsErrorescape intoCoroutineWorker, where it becomes a permanent failure for that run.A failed
recordCheckIn()AFTER a successful post (:147) is swallowed the same way: the notification was shown but never counted, so the stopping rule slips by one, silently.Separately,
setAutoCancel(true)(PeriodNotifier.kt:113) only covers the content tap, so tapping an action button leaves the reminder sitting in the shade to be tapped again; nothing cancels a reminder when the user answers in the app instead; and a forecast that moves does not withdraw an already-posted notification. The stop-asking notification is built inline (ReminderWorker.kt:104-116) bypassingNotificationCopyentirely and hardcoding PRIVATE visibility even for users who chose Direct — so it is the one notification no test inNotificationCopyTest/NotificationPrivacyTestcovers.What to do. Split transient failures (DataStore/SQLite IO) from deterministic ones: retry the first with backoff up to a small limit, end the second quietly. Catch
Exception, notThrowable, soErrors still reach WorkManager. Post first and record second, so a failed record retries the run and re-posts to the same notification id withsetOnlyAlertOnce(true)— one buzz, counted once. Move the stop-asking text intoNotificationCopyso it obeys the privacy mode like everything else. Cancel the posted reminder when an action is applied and when the user answers in the app.Traps. No logging on any of these paths —
core/notificationsis inmodulesSeeingHealthDataandcheckNoHealthLoggingforbids every logging call, which is why the failures are silent today. The in-app dismissal chain must skip its first emission, or the worker's own process will cancel the notification it is about to post.Verify:
a failed check-in write after posting asks for a retry and does not double countanda cancellation is not swallowedinReminderWorkerTest;the stop-asking notice leaks nothing outside DirectinNotificationCopyTest;an in-app answer dismisses the posted reminderandthe first emission at start does not dismiss anythinginReminderCoordinatorTest.