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

   ### Independent verification (isolated checkout of `3bc4a73a`)
   
   Every citation re-read against this branch, every test claim re-executed 
from a clean checkout (`git worktree add --detach` at the branch head). Nothing 
copied from the earlier runs.
   
   **Code citations — re-verified**
   
   - `web/src/pages/studio/Producer.tsx:90` on the base reads `const 
fetchTopicFailedMessage = t('producer.fetchTopicFailed');`, and `LangProvider` 
rebuilds `t` on every language change, so the derived string changes identity 
and the effect (`:171`, deps `[fetchTopicFailedMessage, form, message, 
selectedInstanceId]`) re-runs — confirmed by reading 
`web/src/i18n/LangContext.tsx:39-49` (a plain local function, not memoised).
   - The reset it ran unconditionally sits at `:153` on the base 
(`form.setFieldsValue({ selectedTopic: undefined, producerGroup: undefined })`).
   - On this branch the reset is guarded by `lastResetInstanceRef` (`:98`, 
guard at `:159-162`), and the topic-list refetch still follows on every effect 
run, so the localized failure message keeps following the language.
   - The impact statement in the description is grounded in the form: the TOPIC 
item carries `rules={[{ required: true, message: t('producer.selectTopic') }]}` 
(form region of `Producer.tsx`), so submitting without it is rejected 
client-side; `PRODUCER GROUP` is optional and is passed through to 
`queryProducerConnection` unchanged, which the pre-existing `queries all active 
producer groups when producer group is empty` test pins as a topic-wide scan.
   
   **Test claims — re-executed**
   
   ```
   npx vitest run src/pages/studio/__tests__/Producer.test.tsx -> Test Files 1 
passed (1) | Tests 16 passed (16)
   npx vitest run src/pages/studio                             -> Test Files 8 
passed (8) | Tests 85 passed (85)
   npx tsc --noEmit -p tsconfig.json                           -> clean
   npx eslint src/pages/studio/Producer.tsx \
              src/pages/studio/__tests__/Producer.test.tsx     -> clean
   ```
   
   **Pre-fix failure — reproduced from the same checkout**
   
   With `Producer.tsx` restored to its parent revision and the test kept:
   
   ```
   × keeps the picked topic and producer group when the display language 
changes 476ms
   TestingLibraryElementError: Unable to find an element with the text: 
order-events,
   which matches selector '.ant-select-selection-item'.
   Tests  1 failed | 15 passed (16)
   ```
   
   **Coverage**
   
   The regression covers the new direction (a language switch leaves the picked 
scope alone). The preserved direction — an instance switch still clears it — is 
pinned by the existing `clears stale producer query state before loading a new 
instance`, which asserts the topic selection disappears after switching to 
`instance-2`; it stays green on this branch, so the conditional reset cannot 
silently stop clearing. The two assertions together hold both sides of the 
guard.
   


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