Skip to content

Don't copy existing media files when updating media only#6946

Merged
grzesiek2010 merged 19 commits intogetodk:masterfrom
seadowg:form-download-types
Dec 2, 2025
Merged

Don't copy existing media files when updating media only#6946
grzesiek2010 merged 19 commits intogetodk:masterfrom
seadowg:form-download-types

Conversation

@seadowg
Copy link
Member

@seadowg seadowg commented Oct 27, 2025

Closes #6843

Why is this the best possible solution? Were any other approaches considered?

To make things (hopefully) simpler to understand in the download code, I've introduced a new Type enum to ServerFormDetails that replaces the existing booleans for isNotOnDevice and isUpdated. This allows our download code to make optimizations based on the download scenario explicitly rather than having to infer it from several pieces of information.

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?

There should be no change in behaviour here - the only thing that should change is the performance of updating an entity list for a form that has many media files (and none have changed).

Do we need any specific form for testing your changes? If so, please attach one.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

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

@seadowg seadowg changed the title Add type to ServerFormDetails Add type to ServerFormDetails Oct 27, 2025
@seadowg seadowg force-pushed the form-download-types branch 3 times, most recently from 95899e8 to b09632e Compare October 30, 2025 16:20
@seadowg seadowg changed the title Add type to ServerFormDetails Don't copy existing media files when updating media only Oct 30, 2025
@seadowg seadowg marked this pull request as ready for review October 30, 2025 17:02
@seadowg seadowg requested a review from grzesiek2010 October 30, 2025 17:02
@seadowg seadowg force-pushed the form-download-types branch from b09632e to f9db6d5 Compare November 26, 2025 13:37
@seadowg seadowg requested a review from grzesiek2010 November 26, 2025 14:36
@seadowg seadowg force-pushed the form-download-types branch from 6ad25aa to 493711e Compare December 1, 2025 19:10
@grzesiek2010 grzesiek2010 merged commit b9684e6 into getodk:master Dec 2, 2025
7 checks passed
@seadowg seadowg deleted the form-download-types branch December 2, 2025 11:31
@srujner
Copy link

srujner commented Dec 3, 2025

Tested with Success!

Verified on device with Android 10, 12 and 14

Verified cases:

  • Checked the performance of updating an entity list for a form that has many media files
  • Downloading forms with thousands of media and entities
  • Refreshing list of forms without changing media or adding entity
  • Refreshing list of forms after adding the entity
  • Refreshing list of forms after changing the version and not adding media

@WKobus
Copy link

WKobus commented Dec 3, 2025

Tested with success

Verified on Android 16, 11

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.

Reduce time taken to update form with entity list and many media files

4 participants