-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Make the data retrieval from health stores either perfectly sampled or retriever all data since last execution.
Rationale:
I've found an issue with the way we are collecting data from healthkit.
For example, if I set a 24 hours sampling period, the actual data collection is done at the time the task is run by the user. So, for example, if I tap on "Data query" at 15:00, it will send the data from 15:00 of yesterday to 15:00 of today, but if the day after I do the same at 18:00, it will send the data from 18:00, which means that there will be a "hole" from 15:00 to 18:00 of today's data.
The a solution can be tricky.
We could set the window of time as fixed, for example from 00:00 to 23:59, but if the user sends the data before 23:59 we will miss all the data from that moment to the end of the day.
Another solution is to send the data of the doubled the sampling period (in our case 48 hours). In this case we will receive many duplicates, but we will avoid loosing any data.
Finally, another solution could be sending data between the last time the data was sent and now. This will avoid duplications, but there may be genuine cases where the researcher doesn't want a "full coverage" of the period. So this solution should be probably optional.
The "from last execution" checkbox will instruct the app to retrieve data not from now minus sampling period to now, but from last execution to now.