Use integrity URL to clean up offline entities when hash is unchanged#6910
Merged
grzesiek2010 merged 8 commits intogetodk:masterfrom Oct 17, 2025
Merged
Use integrity URL to clean up offline entities when hash is unchanged#6910grzesiek2010 merged 8 commits intogetodk:masterfrom
grzesiek2010 merged 8 commits intogetodk:masterfrom
Conversation
seadowg
requested changes
Oct 6, 2025
collect_app/src/main/java/org/odk/collect/android/formmanagement/ServerFormUseCases.kt
Outdated
Show resolved
Hide resolved
seadowg
requested changes
Oct 13, 2025
03423bb to
cf1266d
Compare
cf1266d to
c5a798e
Compare
seadowg
requested changes
Oct 14, 2025
collect_app/src/main/java/org/odk/collect/android/formmanagement/ServerFormUseCases.kt
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/formmanagement/ServerFormUseCases.kt
Outdated
Show resolved
Hide resolved
entities/src/main/java/org/odk/collect/entities/LocalEntityUseCases.kt
Outdated
Show resolved
Hide resolved
seadowg
requested changes
Oct 14, 2025
entities/src/main/java/org/odk/collect/entities/LocalEntityUseCases.kt
Outdated
Show resolved
Hide resolved
seadowg
approved these changes
Oct 14, 2025
|
Tested with Success! Verified on a device with Android 10 Verified cases:
|
|
Tested with success Verified on Android 16 |
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 #6768
Why is this the best possible solution? Were any other approaches considered?
This is a result of the discussion we had in the issue. To sum up:
When Collect is set to
only access own Entities, deleted Entities on Central may stay on the device if the hash doesn’t change. The team debated whether Central should update hashes on every delete or whether Collect should always run an integrity check. The decision: treat the hash as list contents and have Collect run an integrity check whenever offline Entities exist.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?
With this change, during form sync, even if the entity list hash hasn’t changed, Collect will use the integrity URL whenever offline entities exist to check for deletions and clear them if needed. The only known case is described in the issue. If you can think of other ways to reproduce it, please share them.
Do we need any specific form for testing your changes? If so, please attach one.
The form from the issue.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest