What triggers a task recalculation in the user's device?

Hi,
ANalyzing task docs, I can notice that task’s events are recalculated often, I would want to know causes of task recalculation,
Some months ago, @diana , tells me about this, Update client-side purging to trigger task recalculation · Issue #8037 · medic/cht-core · GitHub that looks resolved, so one event that triggers task recalculation is

  1. Client side purging

could you help me to complete this list ?

Hi @bamatic

Actually client side purging does not trigger task recalculation.

The events that do are:

  • creating/editing/deleting a contact will trigger recalculations for that contact
  • creating/editing/deleting a report will trigger recalculations for the report subject contact (the patient)
  • submitting a task will trigger recalculations for the task subject contact (the patient)
  • when the user syncs and gets these edits / updates from the server, recalculation follows the same rules above.
  • when loading tasks - for contacts that have not been recalculated in the past 7 days
1 Like

Hi again
I think that a code update triggers a recalculation, am I right ?

Other question, how could I know if some tasks, I’m speaking about CouchDB docs “type”:“task”, have been created in differentes devices ?

Correct, thanks for the addition! Yes, updates in configuration - particularly task code - also trigger recalculations for all contacts.

Other question, how could I know if some tasks, I’m speaking about CouchDB docs “type”:“task”, have been created in different devices ?

Unfortunately, I don’t think there is a way to know at the moment. We don’t include any device related metadata in any of the docs that get created.