unbridled-41 opened a new pull request, #3299:
URL: https://github.com/apache/rocketmq-dashboard/pull/3299

   # PR 1 — fix(metrics): give profile panels and the custom query independent 
request guards
   
   ## Problem / Evidence
   Metrics Explorer uses one shared monotonic `requestId` ref for two 
independent flows: `loadAll` (profile panels) and `runCustomQuery` (custom 
query panel). Any action that triggers both synchronously makes the second flow 
bump the counter while the first is in flight, so the first flow's results 
always fail their freshness guard and are silently dropped:
   
   - Clicking 刷新全部面板 with an applied custom query (`MetricsExplorer.tsx` 
refresh handler: `void loadAll(...)` then `void runCustomQuery(...)`): 
`loadAll` captures N, `runCustomQuery` bumps to N+1 in the same tick → every 
profile panel stays on its spinner forever; the refresh button (loading = 
anyLoading) spins until page reload. 100% reproducible.
   - Switching data sources while a custom query is applied 
(`activateDataSource` runs both).
   - Running a custom query while the initial panel load is still in flight.
   
   Regression test added: `reloads profile panels when refresh also reruns the 
applied custom query` — red on pristine (panel chart never re-renders), green 
after the fix.
   
   ## Root cause / Fix
   `loadAll` and `runCustomQuery` guard two disjoint state slices (`panels` vs 
`customPanel`), so sharing one request generation counter is wrong: each flow 
invalidates the other's in-flight results without producing anything to replace 
them.
   
   Fix: split the counter into `panelRequestIdRef` / `customRequestIdRef` 
(unmount cleanup bumps both). No behavioral change to single-flow ordering 
semantics (profile/profile and custom/custom still supersede older results).
   
   ## Priority & scoring
   PRIORITY 79 = 影响 32 (entire metrics dashboard view permanently frozen after 
a routine action; requires page reload) + 波及范围 13 (core Metrics Explorer used 
on the home dashboard) + 可复现性 18 (deterministic, one click with an applied 
custom query) + 维护价值 16 (clear root cause, minimal split). FIX_CONFIDENCE 92.
   
   ## Tests
   - `npx vitest run src/components/__tests__/MetricsExplorer.test.tsx` → 20/20 
pass (new test red on pristine, green after fix; observed red: chart element 
never re-appeared after refresh).
   - Full web suite (`npx vitest run --testTimeout=60000`): see comment below.
   - `npx tsc --noEmit` clean; `npx eslint` on touched files clean.
   
   ## Risk
   Low. The two refs only affect result-application guards; existing tests 
covering range/profile superseding still pass unchanged.
   
   # PR 2 — fix(message): treat MQClientException NO_MESSAGE key queries as 
empty results
   
   ## Problem / Evidence
   `MQAdminImpl.queryMessage` (rocketmq-client 5.5.0, verified in the resolved 
jar's bytecode) throws `MQClientException(ResponseCode.NO_MESSAGE=208, "query 
message by key finished, but no message.")` when the key matches nothing — it 
never returns an empty `QueryResult`. The Apache provider converts every 
exception into `BusinessException(502)`:
   
   


-- 
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