btlqql opened a new pull request, #5337:
URL: https://github.com/apache/rocketmq-dashboard/pull/5337
### Which Issue(s) This PR Fixes
- Fixes #5045
### Brief Description
`web/src/pages/ops/notificationDeliveries.tsx:150-152` kept the previous
result set when the deliveries list request failed:
```ts
.catch(() => {
if (!cancelled) message.error(t('deliveries.loadFailed'));
})
```
Changing the instance or status filter and hitting a failing request left
the old rows (and `total`) in state, so the previous query's records reappeared
under the new filter after the spinner cleared, with their row retry actions
enabled and pointing at an id from the query the operator had just left.
The failure branch now drops the stale rows (`setItems([])`, `setTotal(0)`),
records `loadFailed`, and the page renders a persistent `Alert` whose retry
button calls the same `refresh()` used by the toolbar, so the retry re-runs the
current filters instead of a stale page. A successful load clears the flag.
This mirrors the instance-list failure affordance that already exists in this
file.
### How Did You Test This Change?
Added a regression to the existing `NotificationDeliveriesPage.test.tsx`:
the first list request resolves a `FAILED` row, the request triggered by the
status change rejects, and the third (retry) request resolves the new filter's
rows.
```powershell
$ cd web && npx vitest run
src/pages/ops/__tests__/NotificationDeliveriesPage.test.tsx
❯ src/pages/ops/__tests__/NotificationDeliveriesPage.test.tsx (7 tests | 1
failed) 13216ms
× clears stale rows and offers a persistent retry when a filtered
reload fails 5695ms
FAIL ... > clears stale rows and offers a persistent retry when a filtered
reload fails
Error: expect(element).not.toBeInTheDocument()
expected document not to contain element, found <span ...>
Broker disk usage
</span> instead
❯ src/pages/ops/__tests__/NotificationDeliveriesPage.test.tsx:258:77
Test Files 1 failed (1)
Tests 1 failed | 6 passed (7) <- before the fix
```
```powershell
$ cd web && npx vitest run
src/pages/ops/__tests__/NotificationDeliveriesPage.test.tsx
✓ src/pages/ops/__tests__/NotificationDeliveriesPage.test.tsx (7 tests)
8261ms
Test Files 1 passed (1)
Tests 7 passed (7) <- after the fix
```
`npx tsc -b` passes and `npx eslint` reports 0 errors/0 warnings on the two
touched files.
Note: #5048 is an older open pull request for the same issue (still open, no
review; its CI run at `2026-10-01T15:15Z` failed every job). This PR is
independent of it and was written against `6a68042f`.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated for non-trivial changes
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
— no new key: the persistent alert reuses the existing `deliveries.loadFailed`
message and `common.retry`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks) — not applicable: frontend-only change, no Java touched
- [ ] New source files carry the ASF license header — not applicable: no new
source file
- [ ] Documentation touched where behaviour changed — not applicable: no
documented behaviour changed
--
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]