unbridled-41 opened a new issue, #4894:
URL: https://github.com/apache/rocketmq-dashboard/issues/4894
### Studio Version
branch: rocketmq-studio
git commit id: 1ef5d860799ac3fabfcdea942cc4dcc77ded7be6 (the revision the
reproduction below was verified against)
deployed as: built from source
### Runtime Environment
OS: Linux (WSL2). The reproduction is a page test rather than a live
deployment.
browser (for UI issues): display-independent; the regression test runs in
the Vitest jsdom environment.
### Connected RocketMQ Cluster
Not required for this reproduction: the defect is in the page's form
handling and reproduces with the topic and producer services mocked.
### Describe the Bug
The Producer page clears the operator's picked TOPIC and PRODUCER GROUP when
the display language changes. The topic-list effect ends its body with an
unconditional `form.setFieldsValue({ selectedTopic: undefined, producerGroup:
undefined })`, and its dependency array contains `fetchTopicFailedMessage`,
which is `t('producer.fetchTopicFailed')` — a value of the current display
language. Switching the language therefore re-runs the effect even though no
instance changed, and the reset executes.
### Steps to Reproduce
1. Open the Producer page and pick a TOPIC (the form requires it).
2. Type a PRODUCER GROUP.
3. Switch the display language in the top bar.
4. Observe that both inputs are empty again while the connection table still
shows the rows of the previous query.
Deterministic form: `web/src/pages/studio/__tests__/Producer.test.tsx` ›
`keeps the picked topic and producer group when the display language changes`.
On 1ef5d860 it fails with `Unable to find an element with the text:
order-events, which matches selector '.ant-select-selection-item'`.
### What Did You Expect to See?
Changing the display language should not touch the query scope. The picked
topic and producer group stay selected; the topic list may still be refetched,
since that effect also feeds the localized failure message.
### What Did You See Instead?
Both inputs are cleared, and the consequences differ by field:
- TOPIC is required by the form (`rules={[{ required: true, message:
t('producer.selectTopic') }]}`), so no query can be started until it is picked
again.
- PRODUCER GROUP is optional and is passed to `queryProducerConnection`
unchanged, so a query submitted before it is retyped silently becomes a
topic-wide scan of every producer group instead of the group the operator
configured (the existing test `queries all active producer groups when producer
group is empty` pins that behaviour).
### Additional Context
- The reset was written for the instance transition — the topic list belongs
to the instance, and `handleInstanceChange` clears the same fields — but it ran
on every effect run.
- Same class, and treated as a defect by this project before: #4589
(BrokerCluster instance selection, fixed by #4590) and #4819 (Ops NameServer
selection, PR #4818).
- Fix and regression test: #4890.
--
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]