zmuxuny opened a new issue, #7214:
URL: https://github.com/apache/rocketmq-dashboard/issues/7214

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   
   - [x] I can reproduce this on the current `master` branch, or I have stated 
the exact version I am running below.
   
   
   ### Studio Version
   
   rocketmq-studio at 127c47b06a268cc74224d5f34c56ec7c36ac0d55.
   
   ### Runtime Environment
   
   Real TopicConfigComparisonModal with React, AntD and Vitest/jsdom, with 
deferred topic-service promises. No live cluster request or mutation was 
performed.
   
   ### Connected RocketMQ Cluster
   
   Not applicable: reproduced with deferred topic-service promises in 
Vitest/jsdom. No live cluster request or mutation was performed.
   
   ### Build Toolchain
   
   _No response_
   
   ### Describe the Bug
   
   Closing Topic configuration comparison while its inventory reads are pending 
does not invalidate the comparison request. If either request later rejects, 
the abandoned modal calls the global message.error and displays a 
loading-failure notification over the page the operator is now using.
   
   The actual TopicPage renders the modal conditionally with comparisonOpen 
(topic.tsx lines 1433-1439), so Close unmounts it. TopicConfigComparisonModal 
only invalidates requestIdRef when changing the instance pair or starting 
another comparison; there is no unmount cleanup.
   
   ### Steps to Reproduce
   
   1. Open Topic configuration comparison and start comparing two instances.
   2. Keep one listAllTopics promise pending.
   3. Close the modal or leave its page.
   4. Reject that pending request. The abandoned comparison displays “Topic 
配置加载失败,请稍后重试”.
   
   A focused regression using the real component clicked Start comparison, 
verified both service calls, unmounted the component and rejected the source 
promise inside act. On unchanged production it fails because message.error is 
called once. Command: node node_modules/vitest/vitest.mjs run 
src/components/__tests__/TopicConfigComparisonModal.test.tsx --maxWorkers=1 -t 
doesNotNotifyAfterComparisonUnmountTest. Result: 1 failed, 11 unrelated tests 
skipped. This is deterministic component coverage, not a live-browser or 
live-broker reproduction.
   
   ### What Did You Expect to See?
   
   Outcomes from an abandoned comparison should not publish global 
notifications or update its disposed UI. A still-mounted comparison must retain 
normal success/error behavior, including React StrictMode. No request 
cancellation or backend change is needed: these are read-only inventory 
requests.
   
   ### What Did You See Instead?
   
   After unmount, rejecting the pending source promise calls message.error once 
with “Topic 配置加载失败,请稍后重试”, instead of ignoring the abandoned comparison.
   
   ### Additional Context
   
   Related #4585 / #4586 cover changing the selected pair while the comparison 
stays mounted. That guard is already present on this baseline; it does not 
invalidate the request on disposal. This report is limited to the component 
lifetime, not a comparison algorithm, API, export, or instance-selection 
redesign.
   
   AI assistance was used for source inspection and the executed reproduction. 
Production code has not been modified for this report.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.


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