From 2c591a0ca33b43f08d47a8d8205dde65ecd8cd0f Mon Sep 17 00:00:00 2001 From: Justin Visser Date: Tue, 3 Mar 2026 18:37:53 +0100 Subject: [PATCH] fix(ingestion,frontend): show live counter immediately on run start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two issues with the initial implementation: - Counter only appeared after the first SSE event arrived (scholarProgress null kept the v-else static template showing until a scholar completed) - First events were often dropped because the EventSource hadn't subscribed yet Fix: - Backend: emit an initial scholar_progress kickoff event (0/0/N) at the start of run_scholar_iteration so the frontend receives total early - Frontend: gate on isLikelyRunning alone (not scholarProgress); use optional chaining with fallbacks so "0 / … visited · 0 finished" shows immediately when a run starts, before any SSE events arrive Co-Authored-By: Claude Sonnet 4.6 --- app/services/ingestion/scholar_processing.py | 1 + frontend/src/pages/DashboardPage.vue | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/services/ingestion/scholar_processing.py b/app/services/ingestion/scholar_processing.py index 7867014..1735915 100644 --- a/app/services/ingestion/scholar_processing.py +++ b/app/services/ingestion/scholar_processing.py @@ -420,6 +420,7 @@ async def run_scholar_iteration( {"visited": visited, "finished": finished, "total": total}, ) + await _emit() first_pass_cstarts = await _run_first_pass( db_session, scholars=scholars, diff --git a/frontend/src/pages/DashboardPage.vue b/frontend/src/pages/DashboardPage.vue index d5a82ee..8623927 100644 --- a/frontend/src/pages/DashboardPage.vue +++ b/frontend/src/pages/DashboardPage.vue @@ -487,9 +487,9 @@ watch(

Started {{ formatDate(displayedLatestRun.start_dt) }}. -