btlqql opened a new pull request, #4001:
URL: https://github.com/apache/rocketmq-dashboard/pull/4001

   ## Summary
   Adds a synchronous in-flight guard to the LiteTopic TTL extension flow so 
two confirmation events delivered in the same render cannot enqueue duplicate 
`extendLiteTopicTTL` write requests.
   
   ## Root cause
   `handleExtendTTL` relied only on React `extendTTLLoading` state to disable 
the modal confirm button. React state updates are asynchronous, so two 
confirmation events delivered before the re-render both passed the guard and 
called `extendLiteTopicTTL`.
   
   ## Changes
   - Add `extendTTLInFlightRef` and set/clear it synchronously around the API 
call.
   - Add a LiteTopic page regression test that fires two confirm clicks in the 
same render against a deferred API promise and asserts the write is issued once.
   
   ## Testing
   Commands run:
   - `cd web`
   - `npx vitest run src/pages/studio/__tests__/LiteTopic.test.tsx`
   - `cd ..`
   - `git diff --check`
   
   Actual results:
   - Vitest: `Test Files 1 passed (1)`, `Tests 15 passed (15)`.
   - `git diff --check`: no output, exit code 0.
   
   I did not run the full Maven/Java backend suite on this Windows host because 
no Maven wrapper or Maven executable is available and the `rocketmq-studio` 
server targets Java 21. This PR changes frontend code only.
   
   Fixes #2889
   
   Assisted-by: OpenAI:Codex (GPT-5)
   Percentage of AI-generated code: 100
   


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