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

Doubled entity in Trees create or update form (with offline entities enabled) #6307

Closed
dbemke opened this issue Aug 5, 2024 · 2 comments
Closed

Comments

@dbemke
Copy link

dbemke commented Aug 5, 2024

ODK Collect version

the master version 1f2e2a6

Android version

10, 14

Device used

Redmi 9T, Pixel 7a

Problem description

When I use the Trees create or update form to create an entity (with offline entities enabled) after refreshing the list of blank forms there are 2 the same entities created (visible in selects). If the offline entities are disabled the issue doesn't occur.
The issue doesn't occur in Entities create or update form (https://staging.getodk.cloud/#/projects/65)

Steps to reproduce the problem

  1. Enable offline entities.
  2. Go to the form Trees Create or Update (I used the form from https://staging.getodk.cloud/#/projects/65 )
  3. In the first question don’t select an answer.
  4. Swipe to species question and choose a species.
  5. In "Set create flag to true” select "yes”.
  6. In "Set the update flag to true” select "no”.
  7. In following questions enter a label and circumference.
  8. Send the form.
  9. Wait a bit and refresh the list of blank forms.
  10. Open the form and check the created entities
@github-project-automation github-project-automation bot moved this to not ready in ODK Collect Aug 5, 2024
@seadowg seadowg moved this from not ready to ready in ODK Collect Aug 7, 2024
@seadowg seadowg moved this from ready to not ready in ODK Collect Aug 7, 2024
@seadowg
Copy link
Member

seadowg commented Aug 7, 2024

@dbemke this looks like an issue in the form/Central to me. You'll see that the question "Provide a new UUID..." has an answer like this:

uuid:b74fd4a5-c790-470b-9ab1-26c67eb1a33e

Collect then treats that as the entity ID (as that ends up being id on the entity node in the submission), but Central seems to happily strip off the uuid and creates a new entity with the ID b74fd4a5-.... That means that Collect treats the two entities as different ones (as they have different IDs). If you delete the uuid: part from the answer then everything should behave as expected.

I'll add the ID to the displayed values in "View entity lists" so issues like this are more obvious.

@matthew-white is Central stripping the prefix intentional here? As far as I can see entity forms are not expected to contain it as the UUID as they use setvalue with uuid() which does not result in a prefixed value. It seems very strange to me that jr:preload="uid" does return a value with a prefix (but that seems to be a specific instance ID thing).

@lognaturel
Copy link
Member

Central does strip the uuid: prefix for any UUID that has one. Like you say, @seadowg, per spec, the prefix isn't expected here. It feels a bit weird that Collect and Central don't have identical behavior in this case but it's very unlikely to ever happen so I'm inclined to close the issue.

@lognaturel lognaturel closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
@github-project-automation github-project-automation bot moved this from not ready to done in ODK Collect Oct 10, 2024
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