← Back to team overview

dhis2-devs-core team mailing list archive

tracker model and removal

 

Hi there,

we are now in the process of developing android clients with offline
support for tracker. This differs from the web apps in the sense that we
will not only support offline capture and subsequent upload of information,
but offline, permanent data access and synchronization.

So the clients must be able to import, update and also delete local
information based on server output. This means that we can no longer "hard"
delete key information on the server, like TEIs, events and data values, as
we must be able to communicate that something has been deleted to the
clients.

To deal with this I suggest that we:

- Add a "removed" property to tracked entity instance, program instance,
program stage instance, tracked entity data value.

- Instead of deleting these objects, we mark them as removed. This requires
an update to the service layer logic. We should probably also make it
possible to "undo" a removal.


The clients can then base themselves on the "last updated" property in
queries for these objects. They could store the timestamp of the last
successful sync (start of process), and then query for objects updated
after that. Removed objects (objects with removed = true) will then be
returned as normal as part of queries and can be used to perform local
removals client side.

Thoughts?

Lars