#1418 Add regression tests for missed automatically taken reminders - #1648
Open
fpMiguel wants to merge 2 commits into
Open
#1418 Add regression tests for missed automatically taken reminders#1648fpMiguel wants to merge 2 commits into
fpMiguel wants to merge 2 commits into
Conversation
Futsch1
requested changes
Aug 14, 2026
| * reminder falls due. On the next app reschedule/start, the missed dose must be | ||
| * caught up and recorded as TAKEN - not left pending and not raised for a manual action. | ||
| * | ||
| * End-to-end on the device (frozen-clock harness): an automatically-taken reminder whose |
Owner
There was a problem hiding this comment.
This does not nail the actual issue and code path which is taken when the device is off. In this case, a special routine is triggered that is called when the Android device is restarted. This cannot be tested via AndroidTest, since it would have to reboot the device (or I am not aware about how to do it). The test you added is no regression test for the referenced issue.
Owner
There was a problem hiding this comment.
I think most of the cases tested here are already covered by other tests. I am sorry, but I do not see additional value in this test...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Regression tests for #1418 ("Battery dead = missing medications"). When the phone is
off at the time an automatically taken dose is due, that dose should still be recorded
as taken. The behavior already exists on
main(fixe657feb2, December 2025, whichpredates the issue). This PR adds tests so it cannot break unnoticed.
No production code changes.
Changes
MissedAutomaticallyTakenReminderTest(JVM / Robolectric, new): three scenarios.A missed automatically taken reminder is caught up and recorded as
TAKEN. A missedreminder without that flag is raised instead. A reminder that fires right on time
behaves correctly. This is the first JVM test for the catch-up path; nothing on
maincovered it before.
MissedAutomaticallyTakenInstrumentedTest(instrumented, new): the scenario fromthe issue, end to end on a device. An automatically taken reminder with a past time is
caught up and shown as taken in the overview, and no "taken" action stays in the
notification shade. This complements
NotificationTest.automaticallyTakenTest, whichfires at a future time.
TestReminderContextfake fix: thecreate()stub returned aLongwhere therepository interface declares
ReminderEvent. Any test using that path crashed. Noexisting test hit it; the new one did.
Testing
MissedAutomaticallyTakenReminderTest, 3/3 green. Also verified from a cleancheckout of
mainwith the fake fix applied.NotificationTest.automaticallyTakenTestpasses 1/1 on the same code.AI was used to create this pull request