-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
"usesEntities" in forms.db after upgrading Collect #6493
Comments
This looks like the current expected behavior to me and I agree it's worth really thinking through carefully. Only forms with the v2024.1.0 Entities spec can create or update Entities offline and it's not possible to have a form with the v2024.1.0 Entities spec in an earlier version of Collect. This makes it seem like the current behavior is ok. If there are only forms that create Entities without attaching the Entity List, I believe that indeed everything is fine. Entities will not be created offline until there's a form update. It's ok for form updates to happen while the form is being filled because the in-memory representation of the Entity List will be used. The complicating factor is that Central v2024.2 will always set the There's a problem any time a form uses the database representation of the Entity List but doesn't have the What I believe does happen now is that forms that access an Entity List will use the database representation without a lock on updates. This can lead to inconsistent data being saved to a form and crashes if the update includes deletes. What I observe is that the moment I get an automatic update from the server, Collect detects Entity Lists attached forms and processes them into their database representations. I would expect that it would also set the Even if we made that change, I think there's still a case where it's possible to get in an inconsistent state. If multiple forms attach the same Entity List, it would be possible for the form update to fail with only some of those forms being updated. Because Collect uses the Entity List name to decide whether to open a database representation or not (#6425), forms that hadn't been updated and therefore weren't marked as |
@lognaturel is it this scenario or something else? https://github.com/getodk/collect/pull/6494/files#diff-5eb1afcd487fe07f5caccf89e6c38534b07e0d49dd218e0929d91bb16cac8174R822 |
I've responded there but for completeness -- the manifest is always checked for Entity Lists regardless of whether there's a form or attachment update and Entity Lists are always processed if identified from the manifest. This means the flag for the form should be set to true any time its manifest is downloaded and there's an Entity List declared in it. |
ODK Collect version
the master version 1a10357
Android version
10, 14
Device used
Redmi 9T, Pixel 7a
Problem description
It seems that setting "true" in "usesEntities" column in forms.db doesn't work as expected after upgrading Collect.
After upgrading the version of Collect only publishing new versions of forms changes the value to "true". Manually refreshing the list of blank forms (with a change in the dataset or not) doesn't set "true". Details and differences in types of forms are described in steps below.
Steps to reproduce the problem
https://test.getodk.cloud/#/projects/576/app-users
Expected behavior
After upgrading the value should change to "true" in forms using entities.
The text was updated successfully, but these errors were encountered: