Order in which forms are processed on the server

Good day,

Consider the case where 2 users visit a patient, and measure the patient
blood sugar level.
The form they complete updates field last_blood_sugar on the patient case.

User A visits the patient on 1 October, measures a value of 5.5. User A is
offline and the submission only gets sent to the server on 10 October when
they have WiFi access.
User B visits the patient on 8 October, measures a value of 4.4. User B is
online and the submission reaches the server immediately.

Question: After 10 October, will last_blood_sugar show 5.5 or 4.4?
In other words, is date_form_completed considered when a form reaches the
server, or are forms only processed in the order they are received?

(Note: I do understand that values loaded from case can only reference
the current case-state.)

Thanks,
Andrew

Hi Andrew,

While CommCare will in some very specific cases attempt to automatically
reconcile the "intended" order of submitted data, generally the server
relies primarily on the order of submission with regards to the final state
of a case.

There are a few reasons for this, the primary one being that historically
(although this is not quite as common in modern usage), the "current"
date/time on a device has not been consistently accurate for many programs,
meaning it was very common for phones to be off by days, months, or even
years on their current date, which would wreak havoc on their submitted
data if the "Device Time" resulted in a shuffling of case data.

If for specific cases, the submit ordering is causing issues, you can
manually request that CommCareHQ process transactions again by clicking
the "Rebuild Case" button on the bottom of HQ's case screen.

Long-term we are hoping to address this more cohesively by following a
token-chain strategy (tracking the 'base state' of a case when a
transaction is reported) to identify these kinds of "highly out of order"
transactions, but currently there's no way to have HQ trigger reshuffling
automatically.

-Clayton

··· On Thu, Oct 12, 2017 at 4:28 AM, Andrew Cawood wrote:

Good day,

Consider the case where 2 users visit a patient, and measure the patient
blood sugar level.
The form they complete updates field last_blood_sugar on the patient
case.

User A visits the patient on 1 October, measures a value of 5.5. User A is
offline and the submission only gets sent to the server on 10 October when
they have WiFi access.
User B visits the patient on 8 October, measures a value of 4.4. User B is
online and the submission reaches the server immediately.

Question: After 10 October, will last_blood_sugar show 5.5 or 4.4?
In other words, is date_form_completed considered when a form reaches the
server, or are forms only processed in the order they are received?

(Note: I do understand that values loaded from case can only reference
the current case-state.)

Thanks,
Andrew

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Just to make a note that clicking 'Rebuild Case' will still apply the forms
in the order they were received by the server (based on form.received_on
date).

Simon Kelly
Director of Server Engineer | Dimagi

··· On 12 October 2017 at 13:51, Clayton Sims wrote:

Hi Andrew,

While CommCare will in some very specific cases attempt to automatically
reconcile the "intended" order of submitted data, generally the server
relies primarily on the order of submission with regards to the final state
of a case.

There are a few reasons for this, the primary one being that historically
(although this is not quite as common in modern usage), the "current"
date/time on a device has not been consistently accurate for many programs,
meaning it was very common for phones to be off by days, months, or even
years on their current date, which would wreak havoc on their submitted
data if the "Device Time" resulted in a shuffling of case data.

If for specific cases, the submit ordering is causing issues, you can
manually request that CommCareHQ process transactions again by clicking
the "Rebuild Case" button on the bottom of HQ's case screen.

Long-term we are hoping to address this more cohesively by following a
token-chain strategy (tracking the 'base state' of a case when a
transaction is reported) to identify these kinds of "highly out of order"
transactions, but currently there's no way to have HQ trigger reshuffling
automatically.

-Clayton

On Thu, Oct 12, 2017 at 4:28 AM, Andrew Cawood acawood777@gmail.com wrote:

Good day,

Consider the case where 2 users visit a patient, and measure the patient
blood sugar level.
The form they complete updates field last_blood_sugar on the patient
case.

User A visits the patient on 1 October, measures a value of 5.5. User A
is offline and the submission only gets sent to the server on 10 October
when they have WiFi access.
User B visits the patient on 8 October, measures a value of 4.4. User B
is online and the submission reaches the server immediately.

Question: After 10 October, will last_blood_sugar show 5.5 or 4.4?
In other words, is date_form_completed considered when a form reaches the
server, or are forms only processed in the order they are received?

(Note: I do understand that values loaded from case can only reference
the current case-state.)

Thanks,
Andrew

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.