Repository navigation
fix(prompts): say a failed read failed, never "No prompts yet" - #1324
Merged
Merged
Conversation
On prod, switching Topics → Prompts made the page's read throw (one request hit the 8 s statement timeout) and the table showed "No prompts yet · Add prompt" for a brand with prompts. A failed read with nothing on screen now says "Couldn't load your prompts." with Try again, and a failed re-read keeps the rows shown (promptsTableState). The visibility summaries degrade like positions and volumes: their columns read — with a warning instead of failing the page. Mentions › Perception's load error gets Try again too (30 and 90 days time out on prod). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
@gkhngyk This one comes from measuring the user's two speed reports on prod in the browser (read-only, Ansvisor brand). The numbers are in the description.
|
4 of 12 tasks
gkhngyk
approved these changes
Oct 22, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good.
- Prompts table: a failed read with nothing on screen now says so and offers Try again; a failed re-read keeps the rows already shown.
- Visibility timeout: it degrades to "—" with a note instead of failing the page.
- Perception tab: Try again reads the same filters again.
Tested on top of main together with #1326: web and server tests, tsc, lint and Prettier pass.
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
From the user's report, measured on prod (read-only, in the browser, on the Ansvisor brand):
Failed to load topics overviewandFailed to load prompt data, both React i18n: wire the Agent page to next-intl #441, meaning the server action threw. One request took 8.6 s, the authenticated statement timeout.loadData's catch leftallPromptsempty withloadingfalse, so a failed read rendered as an empty brand.getPromptsPageDataalready degrades positions and volumes.getPromptVisibilitySummaries(theprompt_visibility_summariesGROUP BY over the window's answers) was not degraded, so one slow read blanked the whole table.This PR (web only) makes a failed read say so, and lets the slow one degrade:
promptsTableState()(prompts/table-state.ts, tested).getPromptsPageData. When the visibility summaries fail or time out, the table still renders. Their columns read —, and a warning toast says the figures are temporarily unavailable, the same way positions and volumes behave. Only a failed prompt roster fails the page.Not in this PR: making those reads fast. Perception's 30/90 d needs
mentions_perceptionnot to unnest every answer's terms for the window and the one before it. That's your #1124 follow-up: a daily per-entity terms rollup, or a narrower read.prompt_visibility_summarieson large windows needs work too. Both will come as separate SQL PRs.Related issue
None. Reported by the user.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checked in light and dark, at 1024 px and wider.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)yarn test: 282 files, 2,488 tests pass. In one full run an unrelated editor test timed out at 5 s under load and passes alone (63/63).yarn buildpasses with CI's placeholders.🤖 Generated with Claude Code