The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
What feature do you want to improve?
We set webapp sync status to success after a successful replication. However, this doesn't account for denied document retries.
We also set the currentSeq as last replicated seq, although this might not reflect the truth, if there were database writes in the meantime (race conditions).
Describe the improvement you'd like
Successful sync status should be displayed when the local (pouch) checkpointer last_seq is the same as the local database update_seq.
The biggest issue with this approach is that PouchDb doesn't expose the API to get the checkpointer document id, and it may be too fragile to just iterate over _local docs to find it.
Describe alternatives you've considered
Leave it as it is.
only for denied retries, add a flag that a denial happened during sync and not show success in those cases, everything else remaining unchanged.
Additional context
With offline user replace, but also with move contacts, it becomes important to trust the sync status completely.
What feature do you want to improve? We set webapp sync status to success after a successful replication. However, this doesn't account for
denied
document retries. We also set thecurrentSeq
as last replicated seq, although this might not reflect the truth, if there were database writes in the meantime (race conditions).Describe the improvement you'd like Successful sync status should be displayed when the local (pouch) checkpointer
last_seq
is the same as the local databaseupdate_seq
. The biggest issue with this approach is that PouchDb doesn't expose the API to get the checkpointer document id, and it may be too fragile to just iterate over _local docs to find it.Describe alternatives you've considered
Additional context With offline user replace, but also with move contacts, it becomes important to trust the sync status completely.