Schedule reminders with WorkManager and no exact alarms #25

Closed
opened 2026-08-18 15:06:56 -05:00 by null · 0 comments
Owner

§31: use WorkManager for persistent, inexact reminder work, and do not request exact-alarm permissions — a period reminder does not need alarm-clock precision, and asking for that permission is Play scrutiny bought for nothing.

What to build in a new core/notifications module:

  • a worker that wakes at the user's reminder time, reads the current forecast, and decides whether anything is due
  • scheduling that survives process death and reboot
  • rescheduling whenever the forecast changes. §31 lists it explicitly, and it is the requirement most likely to be missed: a "Not yet" moves the forecast, so a reminder scheduled against the old one is now wrong. The engine already re-conditions; the reminders have to follow.

The worker must not do the arithmetic itself. CycleStatusRules and the forecast already decide what state the user is in, and a second copy of that logic inside a worker is the classic way for a notification to contradict the screen it deep-links to.

Also from §31: request notification permission at an appropriate moment, not blindly on first launch. Onboarding deliberately does not ask; the right moment is when the user enables a reminder.

Verify: ./gradlew :core:notifications:test covers "is anything due today" for each cycle state; scheduling is inexact (no SCHEDULE_EXACT_ALARM in the merged manifest); and a forecast change cancels and re-enqueues the work.

§31: use WorkManager for persistent, inexact reminder work, and **do not request exact-alarm permissions** — a period reminder does not need alarm-clock precision, and asking for that permission is Play scrutiny bought for nothing. What to build in a new `core/notifications` module: - a worker that wakes at the user's reminder time, reads the current forecast, and decides whether anything is due - scheduling that survives process death and reboot - **rescheduling whenever the forecast changes.** §31 lists it explicitly, and it is the requirement most likely to be missed: a "Not yet" moves the forecast, so a reminder scheduled against the old one is now wrong. The engine already re-conditions; the reminders have to follow. The worker must not do the arithmetic itself. `CycleStatusRules` and the forecast already decide what state the user is in, and a second copy of that logic inside a worker is the classic way for a notification to contradict the screen it deep-links to. Also from §31: request notification permission at an appropriate moment, not blindly on first launch. Onboarding deliberately does not ask; the right moment is when the user enables a reminder. Verify: `./gradlew :core:notifications:test` covers "is anything due today" for each cycle state; scheduling is inexact (no `SCHEDULE_EXACT_ALARM` in the merged manifest); and a forecast change cancels and re-enqueues the work.
null added this to the Batch 05 — Notifications milestone 2026-08-18 15:06:56 -05:00
null closed this issue 2026-08-18 15:27:02 -05:00
Sign in to join this conversation.
No Label
P0
P1
P2
release-blocker
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: null/Privacy-Period-Tracker#25
No description provided.