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

**URL:** <https://forum.communityhealthtoolkit.org/t/what-triggers-a-task-recalculation-in-the-users-device/3328>\
**Category:** Technical Support\
**Tags:** tasks\
**Created:** [February 12, 2024, 6:55pm UTC](https://forum.communityhealthtoolkit.org/t/what-triggers-a-task-recalculation-in-the-users-device/3328 "2024-02-12T18:55:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bamatic](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/bamatic/32/1318_2.png) [@bamatic](https://forum.communityhealthtoolkit.org/u/bamatic)\
**Post date:** [February 12, 2024, 6:55pm UTC](https://forum.communityhealthtoolkit.org/t/what-triggers-a-task-recalculation-in-the-users-device/3328/1 "2024-02-12T18:55:39Z")

</div>

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](https://github.com/medic/cht-core/issues/8037) that looks resolved, so one event that triggers task recalculation is

1. Client side purging

could you help me to complete this list ?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 13, 2024, 2:03am UTC](https://forum.communityhealthtoolkit.org/t/what-triggers-a-task-recalculation-in-the-users-device/3328/2 "2024-02-13T02:03:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bamatic](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/bamatic/32/1318_2.png) [@bamatic](https://forum.communityhealthtoolkit.org/u/bamatic)\
**Post date:** [February 13, 2024, 9:50am UTC](https://forum.communityhealthtoolkit.org/t/what-triggers-a-task-recalculation-in-the-users-device/3328/3 "2024-02-13T09:50:26Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 13, 2024, 11:40am UTC](https://forum.communityhealthtoolkit.org/t/what-triggers-a-task-recalculation-in-the-users-device/3328/4 "2024-02-13T11:40:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 13, 2024, 11:45am UTC](https://forum.communityhealthtoolkit.org/t/what-triggers-a-task-recalculation-in-the-users-device/3328/5 "2024-02-13T11:45:44Z")

</div>

> 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.
