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

Values in an update form are modified after finalizing the form #6382

Open
dbemke opened this issue Aug 29, 2024 · 4 comments
Open

Values in an update form are modified after finalizing the form #6382

dbemke opened this issue Aug 29, 2024 · 4 comments

Comments

@dbemke
Copy link

dbemke commented Aug 29, 2024

ODK Collect version

the master version 9d5e3ae

Android version

10, 14

Device used

Redmi 9T, Pixel 7a

Problem description

Values in an update form are modified after finalizing the form. When I fill the form I see the correct values (previous properties) but after finalizing the form when I go to "Ready to send” and open the form there are new values in the field where are previous values should be.
In the screenshot: on the left - created entity 147147; on the right updated 147147 to 14771477 (check "select tree to update" and circumference vs new circumference)
finalizedOfflineUpdateValues

Steps to reproduce the problem

  1. Download a project with registration and update form (e.g. trees registration and trees update).
  2. In Collect set auto send to off.
  3. Fill the registration form and finalize it.
  4. Go to the update form and select the created entity.
  5. Fill updating the entity check if old values are correct.
  6. Finalize the form.
  7. Go to "Ready to send” to the update form and check the old values.
@seadowg
Copy link
Member

seadowg commented Aug 29, 2024

@dbemke is this only the trees update form? Could you try a different one? We have tests for update forms that aren't having this problem.

@dbemke
Copy link
Author

dbemke commented Aug 29, 2024

Another form with the same steps reproduced

XRecorder_29082024_132757.mp4

@WKobus
Copy link

WKobus commented Aug 29, 2024

This issue also occurs for draft forms, finalizing update form changes values of update draft forms

Steps to reproduce

  1. Open and finalize registration form
  2. Open update form, select previously created entity fill form and save it as draft
  3. Open update form again, select same entity, fill form and finalize it
  4. Go to drafts, open update form and check values

@lognaturel
Copy link
Member

lognaturel commented Aug 29, 2024

I think this is confusing but expected. Opening a filled form reruns calculations which means values are pulled from entity lists again. It should work the same way without offline entities — if you update an Entity List or attached CSV and opened a form you had filled previously it will pull in new values. If you don’t want that behavior you can use the once() function or a trigger in form design.

It's always been an uncomfortable thing about edits on the server. Having a chain of updates makes this much more apparent on the client.

@seadowg seadowg added this to the Later milestone Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: not ready
Development

No branches or pull requests

4 participants