carp.sensing-flutter icon indicating copy to clipboard operation
carp.sensing-flutter copied to clipboard

RecurrentScheduledTrigger does not consider the `time` parameter

Open bardram opened this issue 3 months ago • 2 comments

When creating a RecurrentScheduledTrigger like this for daily recurrence occurring at 18:40:

protocol
  ..addTaskControl(
      RecurrentScheduledTrigger(type: RecurrentType.daily, time: const TimeOfDay(hour: 18, minute: 40)),
      d1,
      phone)
...

The AppTaskController enqueues the AppTask on the current (now) time, which in this case is 18:39:34 (and not at 18:40):

[log] [CAMS DEBUG] AppTaskController - Enqueued SurveyUserTask - id: 9d9865e1-02d9-4ac2-a355-bcd5ac85afaa, type: survey, name: Task #31, title: Sleep Survey, state: enqueued, triggerTime: 2025-10-08 18:39:34.215294. doneTime: null
[log] [CAMS DEBUG] AppTaskController - Enqueued SurveyUserTask - id: c956bbc2-bb36-4149-9f36-a8b2ff48ad59, type: survey, name: Task #31, title: Sleep Survey, state: enqueued, triggerTime: 2025-10-09 18:39:34.215294. doneTime: null
[log] [CAMS DEBUG] AppTaskController - Enqueued SurveyUserTask - id: d0ceb155-62d6-4fe2-b376-31cf48efb71c, type: survey, name: Task #31, title: Sleep Survey, state: enqueued, triggerTime: 2025-10-10 18:39:34.215294. doneTime: null

It seems like the time parameter is ignored.

bardram avatar Oct 08 '25 17:10 bardram