Skip to content

fix: Formulus/honest sync progress and clearer Sync UI#640

Merged
r0ssing merged 4 commits into
OpenDataEnsemble:devfrom
najuna-brian:formulus/sync-progress-ui
May 21, 2026
Merged

fix: Formulus/honest sync progress and clearer Sync UI#640
r0ssing merged 4 commits into
OpenDataEnsemble:devfrom
najuna-brian:formulus/sync-progress-ui

Conversation

@najuna-brian
Copy link
Copy Markdown
Contributor

@najuna-brian najuna-brian commented May 21, 2026

Description

Observation sync previously showed misleading progress: the bar jumped to ~75% immediately, then sat there for a long time while pull/attachments/push ran. A 30-minute UI-only timeout could report “Sync failed” while work continued in the background.

This PR wires progress to real sync work, improves the Sync screen and notifications, and removes the misleading timeout.

Progress reporting

  • Progress is emitted from synkronusApi during pull, attachment manifest/download/upload, and push (not fake 4-step milestones in SyncService).
  • New shared model: formulus/src/sync/syncProgress.ts with phases: pull_observations, pull_attachments, push_attachments, push_observations, app_bundle.
  • Attachment manifest runs once after all observation pull pages (not on every pull page).
  • Cancel checks run between attachment files during download/upload.

Sync screen UI

  • Phase-specific titles (e.g. “Syncing observations”, “Downloading attachments”).
  • Attachments: progress bar + N of M only (no percent line, no filename).
  • Observation pull: indeterminate bar + status text; UI maps “records” → “observations” (display layer only).
  • App bundle update: progress bar only (no duplicate % / “Form bundle” lines).

Other fixes

  • Removed Promise.race 30-minute timeout from handleSync so the UI does not claim failure while sync keeps running.
  • Android foreground notifications use the same phase titles and simplified body text.
image

Drive progress from synkronus pull/push and per-attachment steps instead of
fake four-step milestones. Show phase titles, counts, and current filenames
on the Sync screen and in Android notifications. Run attachment manifest once
after observation pull completes.
The Sync screen timer only stopped awaiting the promise while sync kept
running in the background. Observation sync now runs until it completes,
errors, or the user cancels.
Hide percent and filename during attachment upload/download; show only
the progress bar and N-of-M count. Restore app bundle to bar-only progress.
Map "records" to "observations" in pull progress display text (UI layer).
Copy link
Copy Markdown
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

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

Thanks @najuna-brian ! This is a great improvement!

@r0ssing r0ssing merged commit b2cd31d into OpenDataEnsemble:dev May 21, 2026
10 checks passed
@najuna-brian najuna-brian deleted the formulus/sync-progress-ui branch May 21, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants