Frun1na opened a new pull request, #5665:
URL: https://github.com/apache/rocketmq-dashboard/pull/5665
### Which Issue(s) This PR Fixes
- Fixes #5664
### Brief Description
The delivery detail drawer rendered the row it was opened with. Only the
single-row retry refreshed that snapshot, so a bulk retry ("Retry failed
records on this page") — or another operator retrying the same delivery — left
the drawer showing `FAILED`, the old attempt count and the old `lastError`
while the list behind it showed `PENDING`. The stale state also kept the
drawer's retry button visible, and pressing it is guaranteed to fail: the
backend refuses a retry for a delivery that is no longer FAILED (`Only failed
notification deliveries can be retried`).
The drawer now renders the row the current page reports for the selected id,
falling back to the snapshot when the page no longer carries it (for example
after the filters change while the drawer is open):
```tsx
const currentDelivery = selectedDelivery
? (items.find((item) => item.id === selectedDelivery.id) ??
selectedDelivery)
: undefined;
```
No other behaviour changes: opening, closing, the retry actions and the
optimistic single-row patch stay as they are.
### How Did You Test This Change?
A new case opens the drawer on a FAILED row, runs the bulk retry, and
asserts the drawer follows the reloaded row — it fails on the current code,
where the drawer keeps the snapshot:
```
$ cd web && npx vitest run
src/pages/ops/__tests__/NotificationDeliveriesPage.test.tsx -t 'bulk retry that
queued'
× keeps an open detail drawer in step with a bulk retry that queued its
delivery
TestingLibraryElementError: Unable to find an element with the text:
PENDING.
# with the fix
$ cd web && npx vitest run
src/pages/ops/__tests__/NotificationDeliveriesPage.test.tsx
Test Files 1 passed (1)
Tests 7 passed (7)
```
`npx tsc --noEmit` and `npx eslint` on the two touched files are clean.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [x] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
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]