Repository navigation
fix(prompts): drop the progress count when it cannot move - #752
Merged
Merged
Conversation
A server that does not report live progress left the button reading "Analyzing 0/10" for the whole run. The client was falling back to the number of rows on disk, and those are all written in one go at the very end — so the count sat at zero and then jumped to the total. Rows on disk are not a stand-in for progress. When the status response carries no live figure the count is left out entirely and the button reads "Analyzing...", which says less but nothing false. When the figure is there it is shown and it moves. This is what the page shows against a server predating the live count, so the two do not have to ship together.
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.
Summary
The button still read
Analyzing 0/10for the whole run after #751.#751 gave the run a live progress count and served it from
GET /status/:brandIdasdone. The client, though, treated a missingdoneasanalyzed— the number of rows inprompt_volumes. Since #749 those rows are all written in one go at the very end of the run, so that number is zero for the entire wait and then jumps to the total. Against a server that does not senddone, the page therefore showed a count frozen at0/N, which is exactly the symptom #751 set out to remove.Rows on disk are not a stand-in for progress. When the status response carries no live figure, the count is now left out and the button reads
Analyzing...— less information, but nothing false. When the figure is there, it is shown and it moves.doneis typednumber | nullso the difference between "no live progress reported" and "zero prompts done so far" cannot be collapsed again.Why this matters beyond the immediate bug
The web app and the API server deploy separately. This makes the page correct against a server that predates the live count, rather than requiring the two to land together — the mismatch is what produced the stalled
0/10in the first place.Related issue
None — reported directly from testing.
Type of change
fix— Bug fixHow to test
Against a server with the live count (
donepresent): start an analysis on a brand with several unanalyzed prompts. Expected:Analyzing 1/10,4/10, … climbing, as after #751.Against a server without it: start the same analysis. Expected:
Analyzing...with the spinner, and no number — previouslyAnalyzing 0/10for the whole run.In both cases the button stays disabled for the duration, survives a page refresh, and returns to normal when the run ends.
Verification already done
yarn typecheckandyarn format:checkpass fromweb/.web/, no API change.Not re-run locally:
yarn build. The change is a nullable field and one conditional, both covered by typecheck; CI runs format, lint and typecheck on a clean checkout.Checklist
feature/,fix/,chore/,docs/)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)