unbridled-41 opened a new issue, #3293: URL: https://github.com/apache/rocketmq-dashboard/issues/3293
## Problem `runTraceQuery` in `web/src/pages/instance/message.tsx` bumps `traceGenerationRef` **before** validating its input, and its empty-input branch returns without resetting `traceLoading`. Any in-flight `loadMessageTrace` is invalidated by the bump, so the guarded `finally` — the only place that resets `traceLoading` — is skipped. The 消息轨迹 tab then shows 正在加载轨迹数据… indefinitely, and because the loading text takes render precedence over `traceError`, the validation hint (请输入 Message ID / 请输入 Message Key) set by the empty-input branch is never displayed. ## Steps to reproduce (code-path level) 1. Open a message's 消息轨迹 tab (or click 轨迹 on a row) so a trace load starts with `traceLoading = true`. 2. While that request is pending, clear the Message ID input and click 查询轨迹. 3. The generation becomes stale for the in-flight load; the spinner never clears and the error never shows. ## Evidence / source - Code inspection of the current `rocketmq-studio` branch (base commit 36126024): the empty-input branch of `runTraceQuery` only calls `setTraceError`; `setTraceLoading(false)` appears solely in the generation-guarded `finally` blocks of `runTraceQuery` and `loadMessageTrace`. - Deterministic Vitest reproduction in `MessagePageAsyncState.test.tsx` (red on the unfixed source): `keeps the trace tab responsive when an empty trace query supersedes an in-flight load` fails with `TestingLibraryElementError: Unable to find an element with the text: 请输入 Message ID` — the error is unreachable behind the stuck spinner. ## Impact Client-side only: the trace tab stays on a permanent spinner until the user issues another non-empty trace query or reopens the dialog. No data loss and no server-side effect. ## Expected behavior / acceptance criteria - The empty-input branch must leave the trace tab settled: spinner stopped, stale trace data cleared, validation error visible. - A late in-flight trace response must not resurrect the spinner or replace the error. - Covered by the named regression test (must fail on the unfixed code, pass after the fix). ## Related work - Closed #734 introduced the generation guards for the message page that this defect slips through (its scope was reset-invalidation and cross-message trace overwrite). - Closed #1316 covered the backend rejecting blank trace identifiers with HTTP 400 — a different layer; this issue is the frontend state-machine gap for the same input class. ## PR Draft PR #3156 (includes the fix and the regression test). -- 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]
