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

[carp_mobile_sensing] RandomRecurrentTrigger not working correctly

Open luciamontesinos opened this issue 3 years ago • 2 comments

luciamontesinos avatar Mar 16 '22 10:03 luciamontesinos

The RandomRecurrentTrigger is not working correctly. The logs show that the timers for the triggers are set successfully. however, only some of them get triggered. I added here two examples of the log I'm getting.

Test 1: In this specific test, only 1/7 surveys got triggered

flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - timers has not been scheduled for today (2022-3-16) - scheduling now
flutter: [CAMS DEBUG] Random sampling times: [11:43:00, 11:43:00, 11:42:00, 11:44:00, 11:44:00, 11:42:00, 11:44:00]
2
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 11:43:00, delay: 0:02:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 11:42:00, delay: 0:01:00.000000
2
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 11:44:00, delay: 0:03:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 11:42:00, delay: 0:01:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 11:44:00, delay: 0:03:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - creating cron job : 41 11 * * *
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor state is set to resumed

Test 2: In this case, only 2/5 of the surveys got triggered

flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - resuming cron job : 2022-03-16 13:53:00.007834
flutter: [CAMS DEBUG] Random sampling times: [13:54:00, 13:57:00, 13:56:00, 13:57:00, 13:54:00]
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 13:54:00, delay: 0:01:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 13:57:00, delay: 0:04:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 13:56:00, delay: 0:03:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 13:57:00, delay: 0:04:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - setting up timer for : 13:54:00, delay: 0:01:00.000000
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - creating cron job : 53 13 * * *
flutter: [CAMS DEBUG] RandomRecurrentTriggerExecutor - resuming cron job : 2022-03-16 13:53:00.007834

I tested this several times both with the app open and with the app running in the background, and seems to be a common issue. This didn't seem to be an issue in the past, so not sure what is going on.

luciamontesinos avatar Mar 16 '22 13:03 luciamontesinos

The trigger is not being triggered on iOS in the long run. When the app is used over a weekend.

bardram avatar Mar 23 '22 13:03 bardram

Released with version 0.40.0.

bardram avatar Sep 25 '22 21:09 bardram