Dashboard: fix training list flicker between empty state and actual runs#170
Open
kevinlu1248 wants to merge 1 commit into
Open
Dashboard: fix training list flicker between empty state and actual runs#170kevinlu1248 wants to merge 1 commit into
kevinlu1248 wants to merge 1 commit into
Conversation
The /runs endpoint reads from a Modal volume that can momentarily list empty during a reload, returning a 200 with []. fetchRuns doesn't throw on that, so the auto-refresh would set allRuns = [], flashing "No training runs found yet." and then repopulating on the next 5s poll. Treat a lone empty response as transient when we already have runs: ignore it for up to EMPTY_RUNS_TOLERANCE consecutive polls and keep the current rows. A genuinely persistent empty (real reset) is still accepted once it sticks, and a cold start with no prior data still shows the empty state immediately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The training runs list alternates between "No training runs found yet." and showing the actual jobs every few seconds.
Root cause
GET /runsreads from a Modal volume that can momentarily list empty during a reload, returning a200with[].fetchRunsonly throws on a non-OK HTTP status, so an empty-but-successful response flows through, and the 5s auto-refresh runsallRuns = []. The list flips to the empty state, then repopulates on the next poll — hence the flicker.Fix
Treat a lone empty
/runsresponse as transient when we already have runs: ignore it for up toEMPTY_RUNS_TOLERANCE(3) consecutive polls and keep the current rows. This mirrors the existing catch-block behavior that preserves data on transient failures.allRuns.length > 0).Testing
npm run buildpasses (only pre-existing unused-CSS warnings, unrelated).🤖 Generated with Claude Code