Drive sync: expose progress (files done / total) for UI progress bar #59

Closed
opened 2026-08-02 04:37:12 -07:00 by westfarn · 0 comments
Owner

Parent epic: chat_backend#42
Related FE: chat_web_app#92
Related: #48, #49, #52

Summary

Sync today only exposes coarse last_sync_status (never / pending / ok / error). UI cannot show a real progress bar. Sync loop already knows remote file list and processes files one-by-one in sync_connection — we can track progress.

Proposed approach

On DriveConnection (or sync-status payload), persist / return while syncing:

  • sync_total — files discovered for this run (after listing selected resources)
  • sync_processed — files finished (skip-unchanged counts as processed, or document separately — pick one and document it)
  • optional: sync_added / sync_updated / sync_failed for richer UI copy
  • clear / zero these fields when sync starts; leave final counts until next sync

Serialize on connection GET + sync enqueue response so FE can poll existing connection endpoints.

Acceptance

  • While last_sync_status=pending, connection detail includes sync_processed + sync_total (or equivalent) updating during sync
  • After success/error, final counts remain available until next sync
  • Existing sync behavior unchanged for callers that ignore progress fields
  • Tests cover start → mid → end progress values

Notes

Percent = sync_processed / sync_total when sync_total > 0. Indeterminate spinner OK when listing still running (sync_total unknown).

Parent epic: [chat_backend#42](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/42) Related FE: [chat_web_app#92](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/92) Related: [#48](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/48), [#49](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/49), [#52](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/52) ## Summary Sync today only exposes coarse `last_sync_status` (`never` / `pending` / `ok` / `error`). UI cannot show a real progress bar. Sync loop already knows remote file list and processes files one-by-one in `sync_connection` — we can track progress. ## Proposed approach On `DriveConnection` (or sync-status payload), persist / return while syncing: - `sync_total` — files discovered for this run (after listing selected resources) - `sync_processed` — files finished (skip-unchanged counts as processed, or document separately — pick one and document it) - optional: `sync_added` / `sync_updated` / `sync_failed` for richer UI copy - clear / zero these fields when sync starts; leave final counts until next sync Serialize on connection GET + sync enqueue response so FE can poll existing connection endpoints. ## Acceptance - [ ] While `last_sync_status=pending`, connection detail includes `sync_processed` + `sync_total` (or equivalent) updating during sync - [ ] After success/error, final counts remain available until next sync - [ ] Existing sync behavior unchanged for callers that ignore progress fields - [ ] Tests cover start → mid → end progress values ## Notes Percent = `sync_processed / sync_total` when `sync_total > 0`. Indeterminate spinner OK when listing still running (`sync_total` unknown).
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_backend#59