[carp_mobile_sensing] RandomRecurrentTrigger not working correctly
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.
The trigger is not being triggered on iOS in the long run. When the app is used over a weekend.
Released with version 0.40.0.