From 29006a5cc9680ec80de0bd107986d9e71d3798dd Mon Sep 17 00:00:00 2001 From: Konstantin Ippolitov Date: Wed, 7 Oct 2026 01:20:11 -0400 Subject: [PATCH] fix: run the daily reminder at five past the hour, not on the hour The Recurrence trigger can fire a fraction of a second early. On the hour, the midnight check then read the local hour as 23, failed its own trigger condition and left the work to the 01:00 run, so the reminder arrived an hour late (seen in production on 2026-10-07). The trigger now starts at minute 5. The local-hour 0-3 gate is unchanged, so runs happen at 00:05, 01:05, 02:05 and 03:05 local time. Solution version 1.0.0.4 -> 1.0.0.5. Contract, research R5/R13, data model, quickstart, tasks and README updated to the new times. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 +-- solution/src/Other/Solution.xml | 2 +- ...-B148B1E4-91C0-F111-AAAF-70A8A59D4F56.json | 2 +- .../contracts/reminder-flow.contract.md | 8 +++-- .../004-schedule-page-reminders/data-model.md | 2 +- .../004-schedule-page-reminders/quickstart.md | 4 +-- specs/004-schedule-page-reminders/research.md | 29 +++++++++++++++---- specs/004-schedule-page-reminders/tasks.md | 2 +- 8 files changed, 38 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 846c787..a452957 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Use the object ID shown under **Enterprise applications** in Microsoft Entra, no ## Daily reminder -A scheduled cloud flow, **MedTrack – Daily Reminder**, checks once a day at local midnight and posts one message in Microsoft Teams, as a chat from the Flow bot (shown as "Workflows"). With Teams on your phone, that is a notification: +A scheduled cloud flow, **MedTrack – Daily Reminder**, checks once a day just after local midnight (00:05) and posts one message in Microsoft Teams, as a chat from the Flow bot (shown as "Workflows"). With Teams on your phone, that is a notification: - **Due today** — every Active Medication due that day. Injections count from the last dose; everything else follows its fixed schedule. - **Follow-ups** — a Medication whose intake was missed, on the 1st, 3rd, 5th and 7th day afterwards. Logging it as Taken or Skipped stops the follow-ups. @@ -133,7 +133,7 @@ Earlier versions of this feature sent email, first through the Mail connector an - **Teams holds back phone notifications while you are active in Teams on a computer.** The message is in the chat either way. - **A failed check notifies nobody.** Power Automate sends failure notices to the flow's owner, and the owner is a service principal. The record of each day is a row in the **Reminder Run** table (`ppa_reminderrun`) — outcome Sent, Nothing To Send or Failed, with the step that failed — and the flow's run history. A day with no row at all means the flow could not reach Dataverse. -- **At most one message a day.** A second run on the same day stops at the Reminder Run row. A failed run is retried on the hour until 03:00 local time. +- **At most one message a day.** A second run on the same day stops at the Reminder Run row. A failed run is retried every hour, at five past, until 03:05 local time. - **Testing by hand works only in the first four hours of the local day.** The flow's Run button obeys the same time gate as the schedule. --- diff --git a/solution/src/Other/Solution.xml b/solution/src/Other/Solution.xml index 8de5229..7a651ab 100644 --- a/solution/src/Other/Solution.xml +++ b/solution/src/Other/Solution.xml @@ -6,7 +6,7 @@ - 1.0.0.4 + 1.0.0.5 0 PowerPlatformAdvocates diff --git a/solution/src/Workflows/MedTrackDailyReminder-B148B1E4-91C0-F111-AAAF-70A8A59D4F56.json b/solution/src/Workflows/MedTrackDailyReminder-B148B1E4-91C0-F111-AAAF-70A8A59D4F56.json index 96d708e..859f3f1 100644 --- a/solution/src/Workflows/MedTrackDailyReminder-B148B1E4-91C0-F111-AAAF-70A8A59D4F56.json +++ b/solution/src/Workflows/MedTrackDailyReminder-B148B1E4-91C0-F111-AAAF-70A8A59D4F56.json @@ -53,7 +53,7 @@ "recurrence": { "frequency": "Hour", "interval": 1, - "startTime": "2026-01-01T00:00:00Z" + "startTime": "2026-01-01T00:05:00Z" }, "conditions": [ { diff --git a/specs/004-schedule-page-reminders/contracts/reminder-flow.contract.md b/specs/004-schedule-page-reminders/contracts/reminder-flow.contract.md index 143f6af..2d71cd4 100644 --- a/specs/004-schedule-page-reminders/contracts/reminder-flow.contract.md +++ b/specs/004-schedule-page-reminders/contracts/reminder-flow.contract.md @@ -23,11 +23,15 @@ FR-014 to FR-027 and User Stories 2 and 3. The rules it applies are in | Setting | Value | |---|---| -| Type | Recurrence, every 1 hour, at minute 0 | +| Type | Recurrence, every 1 hour, at minute 5 (`startTime` `2026-01-01T00:05:00Z`) | | Trigger condition | local hour, from `convertFromUtc(utcNow(),