-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Data sync] Make data sync less error prone and easier to maintain #2840
Comments
@shobhitagarwal1612 Let's clean split this work up and make this airtight. |
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. |
A few action items remaining after #2867: Essential cleanup: Nice-to-have:
|
Closing this issue in favor of the above cleanup tickets. W00t! |
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: