[Data sync] Make data sync less error prone and easier to maintain #2840
Labels
type: code health
Improvements to readability or robustness of codebase
Milestone
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
, andSyncStatusViewModel
and related fragment and repositories.Suggestions:
UploadQueueEntry
model object, grouping create LOI+submission mutations together, sorted in reverse chronological order (oldest first, FIFO).LocalMutationSyncWorker
as follows:LocalMutationSyncWorker
running at a time, this should be safe.retry()
the worker.LocalMutationSyncWorker
on "submit", also trigger periodically (15 min?) to catch any "stuck" mutations, ie in case the worker crashed before it couldretry()
for some reason.UploadQueueEntry
s returned by the repo.Mutation.SyncStatus
and split offUploadQueueEntry.Status
See also #2235
@shobhitagarwal1612 @scolsen @sufyanAbbasi @jabramowitz5 @lecrabe @jo-spek @kenstershiro I would suggest prioritizing this over all other feature requests. Let's discuss.
The text was updated successfully, but these errors were encountered: