Skip to content

Use integrity URL to clean up offline entities when hash is unchanged#6910

Merged
grzesiek2010 merged 8 commits intogetodk:masterfrom
grzesiek2010:COLLECT-6768
Oct 17, 2025
Merged

Use integrity URL to clean up offline entities when hash is unchanged#6910
grzesiek2010 merged 8 commits intogetodk:masterfrom
grzesiek2010:COLLECT-6768

Conversation

@grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Sep 30, 2025

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:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 marked this pull request as ready for review September 30, 2025 18:36
@grzesiek2010 grzesiek2010 requested a review from seadowg October 9, 2025 23:16
Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grzesiek2010 grzesiek2010 requested a review from seadowg October 14, 2025 11:14
@grzesiek2010 grzesiek2010 requested a review from seadowg October 14, 2025 12:27
@dbemke
Copy link

dbemke commented Oct 17, 2025

Tested with Success!

Verified on a device with Android 10

Verified cases:

  • issue With Entity access by owner only, Entity not deleted in Collect if deleted in Central while Collect is offline #6768 doesn't occur
  • regression checks in forms with entities
  • deleting entities with "Access all Entities" and "Only access own Entities" set in Central and checking the list of entities in Collect
  • deleting entities using single and bulk deletion on Central
  • updating a deleted entity
  • updating the list of entities in Collect after deleting and edited entity in Central
  • updating the list of entities in Collect after adding and deleting an entity created on an older version of Collect

@WKobus
Copy link

WKobus commented Oct 17, 2025

Tested with success

Verified on Android 16

@grzesiek2010 grzesiek2010 merged commit a93c629 into getodk:master Oct 17, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

With Entity access by owner only, Entity not deleted in Collect if deleted in Central while Collect is offline

4 participants