Skip to content

fix: run the daily reminder at five past the hour, not on the hour - #24

Merged
kippolitov merged 1 commit into
mainfrom
fix/reminder-trigger-offset
Oct 7, 2026
Merged

kippolitov merged 1 commit into
mainfrom
fix/reminder-trigger-offset

Conversation

@kippolitov

Copy link
Copy Markdown
Owner

Problem

In production the daily reminder went out at 1 AM instead of midnight.

The flow wakes every hour and only runs when the local hour is 0 to 3. A Recurrence trigger does not fire exactly on time: of 24 hourly evaluations in production, 7 started before the hour, by up to 0.4 s. On 2026-10-07 the midnight evaluation started at 03:59:59.597Z, which is 23:59:59 Eastern, so the trigger condition read hour 23 and skipped the run. The 01:00 retry did the work an hour late, outside SC-006's 15 minutes.

No reminder was lost. The hourly retries caught it.

Change

  • Flow: the trigger's startTime moves from 2026-01-01T00:00:00Z to 2026-01-01T00:05:00Z. 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.
  • Docs: the flow contract, research R5 (the production finding and why padding the condition was rejected) and R13, the data model, quickstart, tasks (note on T031) and README use the new times.

spec.md is unchanged: "at local midnight" is the requirement, and 00:05 is within its 15-minute target.

Checks

  • The flow JSON parses.
  • scripts/ci/assert-no-envvar-values.ps1 -Path solution/src passes.
  • The flow has not been run with the new schedule. The first night after deployment is the test: a Reminder Run row created at about 00:05 local.

After merge

  1. Merging redeploys dev.
  2. Production needs a "Promote to Production" run. Avoid running it between midnight and 12:15 AM Eastern: the import turns the flow off and on and could miss the 00:05 check.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 05:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Documentation still reports the prior solution version and gives incomplete guidance for non-whole-hour time zones.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

Moves the daily reminder away from the hourly boundary to prevent early trigger evaluations from delaying reminders.

Changes:

  • Schedules hourly evaluations at five past the hour.
  • Bumps the solution version to 1.0.0.5.
  • Updates reminder timing documentation and operational guidance.
File Description
README.md Documents reminder and retry times.
specs/​004-schedule-page-reminders/​tasks.md Records the schedule adjustment.
specs/​004-schedule-page-reminders/​research.md Documents production evidence and rationale.
specs/​004-schedule-page-reminders/​quickstart.md Updates nightly verification expectations.
specs/​004-schedule-page-reminders/​data-model.md Updates the retry cutoff time.
specs/​004-schedule-page-reminders/​contracts/​reminder-flow.contract.md Revises the recurrence contract.
solution/​src/​Workflows/​MedTrackDailyReminder-B148B1E4-91C0-F111-AAAF-70A8A59D4F56.json Moves recurrence start to 00:05Z.
solution/​src/​Other/​Solution.xml Bumps the solution version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

</LocalizedNames>
<Descriptions />
<Version>1.0.0.4</Version>
<Version>1.0.0.5</Version>
Comment on lines +640 to 642
- **Half-hour-offset time zones**: with an hourly trigger the check runs at 00:35 local in
such zones, outside SC-006's 15-minute target. Not the owner's zone. Moving to a
30-minute trigger fixes it if ever needed.
@kippolitov
kippolitov merged commit 5264e63 into main Oct 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants