unbridled-41 opened a new issue, #4731:
URL: https://github.com/apache/rocketmq-dashboard/issues/4731
### Studio Version
branch: rocketmq-studio
git commit id: 7ce9a68215c4cd1c7025013d02135b43b6aa6ba1
### Problem
The asset/dashboard preview modal renders a failed request as an empty box:
after the transient error toast disappears, the operator sees a blank pane with
no error text and no way to retry, and cannot tell a failed request from an
empty document.
Two sibling components share the defect:
- **Alert rule assets** (业务告警 page): `handleView`
(`web/src/components/AlertRuleAssetList.tsx:110-129`) catches the failed
`getAlertRuleAsset(name)` and only calls `message.error` (`:120-123`);
`viewContent` stays `''`. The modal body branches on `viewLoading` alone
(`:267-283`), so once loading ends the `<pre>` renders an empty string.
- **Grafana dashboards**
(`web/src/components/GrafanaDashboardList.tsx:107-126`, catch at `:117-120`,
modal body `:286-303`): identical shape for `getGrafanaDashboard(uid)`.
Both components already implement the correct pattern for their *list*
request — an error state with a retry button (`AlertRuleAssetList.tsx:232-248`,
and the Grafana list equivalent) — so the preview path is the one load in these
files that never surfaces its failure.
Trigger (deterministic): open 业务告警 (or the Grafana 看板 list), click 查看/View
on a row while the preview request fails (4xx/5xx/timeout, e.g. the asset file
is unreadable or the backend restarts). The modal opens, the toast flashes
once, and the pane stays empty for as long as the modal is open; the operator
must close and reopen it to try again.
### Evidence
- `web/src/components/AlertRuleAssetList.tsx:110-129` — `catch` sets no
state (`message.error` only), `viewContent` remains `''`.
- `web/src/components/AlertRuleAssetList.tsx:267-283` — `viewLoading ?
loading : <pre>{viewContent}</pre>`; there is no failure branch to render.
- `web/src/components/GrafanaDashboardList.tsx:107-126` and `:286-303` —
same two paths for dashboards.
- Contrast inside the same files: the list request has `loadError` + an
`Alert` with a retry button (`AlertRuleAssetList.tsx:232-248`), which is
exactly the treatment the preview lacks.
- Regression test added with this report (fails on 7ce9a682): mock the
preview request to reject once and then resolve; click View; the dialog must
contain a retry button, and clicking it must render the content
(`web/src/components/__tests__/AlertRuleAssetList.test.tsx`,
`.../GrafanaDashboardList.test.tsx`).
### Impact
An operator investigating an alert rule asset or a dashboard during a
backend blip sees a blank preview and no explanation, with no retry path inside
the modal; the failure is visible only for the few seconds the toast lives. The
same request succeeds on a manual reopen if the backend recovered, so the page
silently makes a recoverable read look like an empty document.
### Expected behavior
A failed preview renders an error state inside the modal (message + retry),
the retry re-issues the request for the asset/dashboard being previewed, and a
later success replaces the error with the content — matching the failure
handling the list request in these same components already has.
### Related work
- #4609 (PR #4615) — failed config-diff request rendered as a permanent
loading banner: same "failure has no surface" family, cluster page.
- #4612 (PR #4618) — failed registry load silently rendered as empty tables:
same family, cluster page.
- #4599 (PR #4603) — failed audit summary rendered as zero statistics: same
family, ops page.
#
## PR
Fix: TBD.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]