Create offline entities from entities in repeats#6978
Merged
grzesiek2010 merged 41 commits intogetodk:masterfrom Jan 8, 2026
Merged
Create offline entities from entities in repeats#6978grzesiek2010 merged 41 commits intogetodk:masterfrom
grzesiek2010 merged 41 commits intogetodk:masterfrom
Conversation
19f3925 to
6780aea
Compare
…rence to the entity group inside EntityFormExtra
6780aea to
385de12
Compare
grzesiek2010
commented
Dec 8, 2025
test-forms/src/main/resources/forms/two-questions-entity-update.xml
Outdated
Show resolved
Hide resolved
grzesiek2010
commented
Dec 8, 2025
collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/EntityFormTest.kt
Outdated
Show resolved
Hide resolved
seadowg
requested changes
Dec 10, 2025
Member
seadowg
left a comment
There was a problem hiding this comment.
Just had an initial skim and answered your question!
collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/EntityFormTest.kt
Outdated
Show resolved
Hide resolved
211e521 to
dfec7be
Compare
seadowg
requested changes
Dec 22, 2025
collect_app/src/androidTest/java/org/odk/collect/android/feature/formentry/EntityFormTest.kt
Outdated
Show resolved
Hide resolved
entities/src/main/java/org/odk/collect/entities/javarosa/parse/EntityFormParseProcessor.kt
Outdated
Show resolved
Hide resolved
entities/src/main/java/org/odk/collect/entities/javarosa/parse/EntityFormParseProcessor.kt
Outdated
Show resolved
Hide resolved
entities/src/main/java/org/odk/collect/entities/javarosa/parse/EntityFormParseProcessor.kt
Outdated
Show resolved
Hide resolved
.../main/java/org/odk/collect/entities/javarosa/finalization/EntityFormFinalizationProcessor.kt
Show resolved
Hide resolved
3d5910c to
4852994
Compare
4852994 to
e6f7d29
Compare
seadowg
requested changes
Jan 7, 2026
...ndroidTest/java/org/odk/collect/android/feature/formentry/entities/EntityFormApprovalTest.kt
Show resolved
Hide resolved
seadowg
approved these changes
Jan 8, 2026
|
We finished testing for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6876
Why is this the best possible solution? Were any other approaches considered?
The main change worth noting is that I reworked
EntityFormExtrato store a list ofSaveToobjects. Previously, it held only a pair containing a reference and a value. However, to reliably matchSaveToentries to their entities, I also needed to store the corresponding entity group reference. I obtain that by locating the nearest entity block. Thanks to this, the lookup is performed only once when the form is opened for the first time and then cached. As a result, form finalization does not requires any complex matching operations.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
This adds support for creating entities from multiple regular groups, repeat groups, and nested repeats, all using different datasets. Instead of being limited to creating just one entity per form, as is currently the case, we can now handle essentially any scenario we need.
Be creative, as always! I’m sure you already have a number of forms with entities, so the first step is to ensure there are no regressions. After that, we can adapt those forms to take advantage of the new possibilities.
Do we need any specific form for testing your changes? If so, please attach one.
Any variations of forms that include entities and groups/repeats.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
It's already there getodk/docs#1987.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest