Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline entities – order of sending and versions #6164

Closed
dbemke opened this issue May 31, 2024 · 5 comments
Closed

Offline entities – order of sending and versions #6164

dbemke opened this issue May 31, 2024 · 5 comments

Comments

@dbemke
Copy link

dbemke commented May 31, 2024

ODK Collect version

the master version d67e55a

Android version

10, 14

Device used

Redmi 9T, Pixel 7a

Problem description

If I create an entity offline (finalize the form), I go to update form and update the created entity (finalize the form). I go to Ready to send and select all- send forms. I refresh the list of forms.
In Collect there is the updated entity. In Central entity is created but without updated values.
Afterwards updating such an entity results only in a submission in the update form (present in Central) but doesn’t "influence” the entity (doesn’t get updated).

Steps to reproduce the problem

  1. In experimental settings enable local entities.

  2. Go to entity lists.

  3. Tap the three dots – Add entity list.

  4. Enter a name of a entity list that exists in registration form and an update form in the device (e.g. "trees”) and tap "add”.

  5. Go to settings- form management – auto send set to off.

  6. Go to start new form and fill and finalize a registration form (to create an offline entity).

  7. Go to update form and update the created entity and finalize the form.

  8. Go to Ready to send – tap select all – send selected

  9. Go to Start new form and refresh the list of forms.

  10. Open the update form and check the list of entities.

  11. Go to Central to the entities data tab and check the list of entities

  12. Update the entity in Collect and send the form to Central

  13. Go to Central to the entities data tab and check the list of entities ( is it v1 or v3).

@seadowg
Copy link
Member

seadowg commented Jun 4, 2024

@dbemke I think this is a duplicate of #6128 right? The problem is that the update form gets submitted before the create so Central doesn't know what to do with it. It's important to point out that, long term, Central should be able to handle this scenario even if forms are manually sent out of order.

@dbemke
Copy link
Author

dbemke commented Jun 4, 2024

I don't know because I'm not really sure if it's the only factor in the steps mentioned above

@seadowg
Copy link
Member

seadowg commented Jun 4, 2024

@dbemke could you try sending forms manually in oldest to newest order (so you'd get the create form before the update form) and check you can't reproduce?

@dbemke
Copy link
Author

dbemke commented Jun 4, 2024

I'm not sure if I understand well. I followed there steps: I finalized a registration form, finalized an update form (updating the created entity) then sent manually first the update form then the registration form. I refreshed the list of blank forms and in the update form I get the newest (updated entity) in Collect and in Central the entity is still the registration version

@seadowg
Copy link
Member

seadowg commented Jun 4, 2024

I'm not sure if I understand well. I followed there steps: I finalized a registration form, finalized an update form (updating the created entity) then sent manually first the update form then the registration form. I refreshed the list of blank forms and in the update form I get the newest (updated entity) in Collect and in Central the entity is still the registration version

I mean if you try the same steps but submit the registraton form first instead then you won't run into any issues right? That would confirm that this and #6128 are the same thing.

Sending the entity submissions "out of order" will always cause problems: you can't update an entity before it's been created. The long term solution will most likely require Central to "hold onto" update submissions until it receives the create submissions. The best we can do on the Collect side (short of disabling manual sending) is to correct the default order we send forms in so that we send older ones first (which is what #6128 is specifiying).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: done
Development

No branches or pull requests

3 participants