Add real-time progress tracking to inventory sync #508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Adds real-time phase-by-phase progress tracking to inventory sync, replacing generic "Syncing..." with specific phase info and item counts.
Features
1. Phase-by-Phase Progress (6 phases)
2. Real-Time Item Counts
Button shows:
⏳ Discovering Ad Units: 243 items (1/6)3. "Navigate Away" Message
Shows info alert: "💡 Tip: Feel free to navigate away - the sync continues in the background!"
4. Polling Updates Every 2 Seconds
Frontend polls status endpoint and updates button text in real-time
Technical Implementation
Database:
progressJSONB column tosync_jobstableed7d05fea3be_add_progress_tracking_to_sync_jobs.pyBackend (
gam.py):sync_all()call with phase-by-phase discoverySyncJob.progressafter each phase completionupdate_progress(phase, phase_num, total_phases, count)Frontend (
tenant_settings.js):progressobject from status endpointStatus Endpoint:
progressfield in response if available{"phase": "...", "phase_num": 1, "total_phases": 6, "count": 243}UX Improvements
Before:
After:
Plus info message: "💡 Feel free to navigate away - the sync continues in the background!"
Testing Notes
Related
Follow-up to PR #507 (background sync with polling)
🤖 Generated with Claude Code