Frun1na opened a new pull request, #6093:
URL: https://github.com/apache/rocketmq-dashboard/pull/6093

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6092
   
   ### Brief Description
   
   The topic detail modal tracks a failed route read and says so 
(`web/src/pages/instance/topic.tsx:1130`:
   "路由诊断:加载失败 … 下面的结论与重建操作暂不可用"), but only the banner used that flag. The 
tiles, the issue
   list and the recommendations kept rendering `analyzeTopicRoutes([])` for the 
routes that were never read, so
   directly under the banner the modal still reported `Broker 数 0` / `可写 Broker 
0` / `可读 Broker 0` /
   `Replica 数 0` and the critical finding "Broker 上没有 Topic 路由" with its 
recommendations.
   
   Those three blocks now render only when the read succeeded, which is what 
the flag was introduced for (see
   the comment above `routeLoadFailedTopics`, `:360-363`). This is the other 
half of #5442 (`1f94ba03`), which
   fixed the banner for this state. The route table is left as it is: with no 
rows read it was already empty.
   
   User-visible change: opening a topic whose route read failed no longer shows 
zeroed broker tiles and a
   "this topic has no broker route" verdict under the failure banner. No new 
user-facing copy is introduced.
   
   ### How Did You Test This Change?
   
   ```
   $ cd web && npx eslint src/pages/instance/topic.tsx
   # clean
   
   $ cd web && npx prettier --check src/pages/instance/topic.tsx
   # clean
   
   $ cd web && npx vitest related --run src/pages/instance/topic.tsx 
--maxWorkers=1 --fileParallelism=false
    ✓ src/pages/instance/__tests__/TopicPage.test.tsx (41 tests) 60025ms
    ✓ src/App.test.tsx (10 tests) 444ms
    Test Files  2 passed (2)
         Tests  51 passed (51)
   
   $ cd web && npx tsc -b
   # clean
   ```
   
   The extended test fails without the fix:
   
   ```
   $ cd web && npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx
    FAIL src/pages/instance/__tests__/TopicPage.test.tsx > TopicPage > shows a 
retry instead of the rebuild action when the route request itself failed
    Error: expect(element).not.toBeInTheDocument()
    expected document not to contain element, found <span … >Broker 数</span> 
instead
     ❯ src/pages/instance/__tests__/TopicPage.test.tsx:620:48
    Test Files  1 failed (1)
         Tests  1 failed | 40 passed (41)
   ```
   
   (That run is `pages/instance/topic.tsx` reverted and the test kept, which is 
also the mutation check; the case
   is green again once the fix is restored.)
   
   ### 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)
   - [ ] 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]

Reply via email to