google / ground-android

Ground mobile data collection app for Android
http://groundplatform.org
Apache License 2.0
245 stars 119 forks source link

[Data sync] Make data sync less error prone and easier to maintain #2840

Open gino-m opened 1 week ago

gino-m commented 1 week ago

The current data sync workflow is complicated, making it hard to understand and prone to errors (#2726, #2377, #2751, #2684). This is arguably most critical part of the system, so improving this should be P0+ priority.

The main components in question are LocalMutationSyncWorker, MediaUploadWorker, and SyncStatusViewModel and related fragment and repositories.

Suggestions:

See also https://github.com/google/ground-android/issues/2235

@shobhitagarwal1612 @scolsen @sufyanAbbasi @jabramowitz5 @lecrabe @jo-spek @kenstershiro I would suggest prioritizing this over all other feature requests. Let's discuss.

gino-m commented 1 week ago

@shobhitagarwal1612 Let's clean split this work up and make this airtight.

shobhitagarwal1612 commented 6 days ago

Should we also add a manual button to trigger data sync?

gino-m commented 4 days ago

Should we also add a manual button to trigger data sync?

The current behavior is to automatically retry whenever a connection is available, and I plan to add logic to periodically check the queue in case the last sync crashed. In that case, what purpose would the button serve? My concern is that by adding a button users will think they need to click it to have data be uploaded.