getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
718 stars 1.38k forks source link

Finalized instance of form that create or update entity can be deleted after app upgrade #6442

Closed WKobus closed 1 month ago

WKobus commented 1 month ago

ODK Collect version

the master version cff7a1e9e2c535099db878ac90798b9425c80e3d

Android version

10, 14

Device used

Redmi 7, Galaxy M23

Problem description

Finalized instance of form that create or update entity, created on version, where it was possible to delete finalized instances of forms that create or update entity, can be deleted after an app upgrade.

Steps to reproduce the problem

Preconditions:

  1. Install Collect v2024.2.1
  2. Scan project with entity registration or update form e.g. user "tree" from https://test.getodk.cloud/#/projects/523
  3. Go to start new form
  4. Open trees update form
  5. Fill form and finalize it
  6. Upgrade collect to current master
  7. Open collect and go to delete form - saved forms
  8. Select previously finalized form and delete it
lognaturel commented 1 month ago

The new entity values that would have been created or updated by that finalized form are not available from the forms either right?

We want to avoid deleting a finalized submission that has been applied to the local entity list because that may lead to stale and confusing data sticking around for a long time. But if the entity create or update wasn’t applied locally it’s ok to delete.

WKobus commented 1 month ago

I was unable to check if new entity value is available after upgrade on version i mentioned in issue - v2024.2.1, because forms with new spec are not working on v2024.2.1 and i was unable to create offline entity due to this, however I've used apk with master version, that was created 3 days before merging PR with deleting saved entity forms - #6311 and on this version after creating offline entity and upgrading to current master I was able to delete finalized form that created entity and entity from this finalized form was available in update forms.

lognaturel commented 1 month ago

That makes sense. The upgrade path for a user would be from v2024.2.1 to v2024.3.0 so there wouldn't be any entities saved locally. You could simulate this by using a build right after v2024.2.1 was released but also I'm pretty confident this is what would happen. If that sounds right, we can close this issue.

WKobus commented 1 month ago

Yeah, You're right I've checked it on build right after v2024.2.1 was released and after upgrading there were no entities saved locally, so it's okay to close this issue.