unbridled-41 commented on PR #4888:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4888#issuecomment-5773770980

   ### Independent verification (isolated checkout of `5b1617b6`)
   
   Re-read every citation in the description against this branch and 
re-executed every test claim from a clean checkout (`git worktree add --detach` 
at the branch head, so no other work in my tree can influence the run). Nothing 
below is copied from the earlier runs.
   
   **Code citations — re-verified**
   
   - The two publish branches in `runCustomQuery` are the only writers of 
`customPanel`: `+ 1` on the generation at `MetricsExplorer.tsx:724`, 
`setCustomPanel({ loading: false, data … })` at `:766` and `setCustomPanel({ 
loading: false, error … })` at `:785`, both inside the freshness guard. 
`setCustomPanel({ loading: true })` at `:725` is therefore never cleared when 
the generation is discarded — the stranded state described in the description.
   - The profiles effect ends with the cleanup that bumps **both** generations 
(`:705-711`); its body only restarts the panel flow through `loadAll(...)`. 
Confirmed: nothing in the effect body (or in any other effect) restarts the 
custom flow.
   - The dependency chain quoted in the description is the **base** 
(`1ef5d860`) state, as labelled there: `runQuery` `[copy.defaultDataSource, 
instanceId]`, `loadAll` `[instanceId, queryErrorFallback, runQuery]`, 
`runCustomQuery` `[copy.customTitle, instanceId, queryErrorFallback, 
runQuery]`. For readers checking the branch instead: after the fix `runQuery` 
is `[instanceId]` and `loadAll`/`runCustomQuery` are `[instanceId, runQuery]`, 
with the three labels read from `queryLabelsRef` (`:535-547`). The cleanup 
still bumps `customRequestIdRef` at `:710` on purpose — the instance-transition 
path restarts that flow, which is what makes the discard safe there and not on 
a language switch.
   
   **Test claims — re-executed**
   
   ```
   npx vitest run src/components/__tests__/MetricsExplorer.test.tsx   -> Test 
Files 1 passed (1) | Tests 30 passed (30)
   npx vitest run src/components                                      -> Test 
Files 8 passed (8) | Tests 88 passed (88)
   npx tsc --noEmit -p tsconfig.json                                  -> clean
   npx eslint src/components/MetricsExplorer.tsx \
              src/components/__tests__/MetricsExplorer.test.tsx      -> clean
   ```
   
   **Pre-fix failure — reproduced from the same checkout**
   
   With `MetricsExplorer.tsx` restored to its parent revision and the test kept 
(`git checkout HEAD~1 -- web/src/components/MetricsExplorer.tsx`):
   
   ```
   × keeps the pending custom query when the display language changes 798ms
   AssertionError: expected "vi.fn()" to be called 1 times, but got 2 times
   Tests  1 failed | 29 passed (30)
   ```
   
   The second symptom quoted in the description (the custom result never 
rendered) was reproduced separately during development by neutralising the two 
call-count assertions, leaving `Unable to find an element with the text: 
cluster=prod / query=custom`.
   
   **Coverage**
   
   The regression pins both halves of the fix — no profile re-fetch on a 
language switch, and the in-flight custom result still published — and the 
instance-transition tests that #3299 introduced (`re-runs the committed custom 
query when the dashboard instance changes`, `refreshes profile panels and the 
custom query independently`) stay green, so the generation guards for the 
instance path are unchanged.
   


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