Help with task doc undestanding

Hi community,
I need some help, I’m trying to figure out the meaning of these two “series” of tasks for the same user

First, in our malnutrtion workflow a patient_assessment with has_MAM==="true" triggers a task with 8 events, I want to understant about the 16 rows in the spreadsheet :

  • why the 8 tasks with authoredOn 11/11/2022 7:59:54 have been recalculated again ? because the user has connected from another device/browser ?

  • In this case the user in the “clean” device has downloaded the assessment report that triggers the task events and tasks get recalculated at 11/11/2022 7:59:54, but why the “clean” device does not know that the task follow_up_count ===1 has been completed in the othe device at 10/12/2022 6:27:56? is the reason that tasks are not downloaded to the users devices and are only recalculated in the device as needed (only reports are downloaded ??) or tasks are downloaded if available on the server but in this case the user in the other device had not yet synced and so, the task with follow_up_count 1 completed at 10/12/2022 6:27:56 was not on the server at 11/11/2022 7:59:54 ?

Hi @bamatic

Are you certain that this user has logged in on two devices at once?
If this is indeed the case, the dynamic of tasks can become quite chaotic, and making sense of it is difficult because there’s no way of knowing the state of the device at the time of task generation / update, since there’s no guarantee that sync was completed for either one of devices. With incomplete and unknown sync state, I think we’re left only with guesses.

Yes, they are.

Thank you @diana
No, I’m not sure that they are two devices, I’m only trying to figure out, why tasks in completed state are “changing” later to failed, I was thinking that maybe the user device has not have access to tasks with state completed on the server so in the device the tasks have been recalculated and since dueDate is passed, they are marked as failed, but if tasks and reports are both downloaded the guess of a second device with no data makes no sense

I want to know when we do not get a report from a task in a followup, if the task has been failed and the user has not answered the task in time, or if the task has been candelled and the user has not been notified, with some tasks data is quite easy to know but when the same source_id report has several task docs for the same task event at different authoredOn times for the same follow_up_count I do not know what is the correct intrepretation

It looks like if we have a task that is marked as completed with a given follow_up_count at a given time, if in a later moment we have another task with the same follow_up_count marked as failed or cancelled, that the task has been completed

Hi @bamatic

No, I’m not sure that they are two devices

In telemetry documents, you should see a metadata.deviceId property. This is unique per device. If you find multiple values for this entry for the same user, then you can be certain that two devices were used. However not finding the telemetry entry does not exclude a second device necessarily (if the account just logged in once, in a browser for example, it would not generate telemetry).

I’ve looked at telemetry docs and selected the ones for the dates that generated tasks:
telemetry-2022-10-6-kadidiaar-00a8167b-5c3d-4656-b397-8a717bea25f7 has deviceId 00a8167b-5c3d-4656-b397-8a717bea25f7
telemetry-2022-11-11-kadidiaar-2c6ce306-c4e7-4c82-9cb9-c1f682a18449 has deviceId 2c6ce306-c4e7-4c82-9cb9-c1f682a18449

It’s certain that two devices are used, but I don’t think they are used in parallel. For some reason, this user has not generated telemetry between 2022-10-6 and 2022-11-11. My guess is that, on 2022-11-11, the user logged in again on a new device (or cleared cache on the old device) and partially replicated before starting using the app, causing tasks to get re-generated randomly while the existing tasks were downloading in the background.

As I said before, task dynamics can be chaotic with changing devices and incomplete replication.

Are you seeing duplicate reports that complete the same task?