Loyal-Young opened a new pull request, #5779:
URL: https://github.com/apache/rocketmq-dashboard/pull/5779

   ### Which Issue(s) This PR Fixes
   
   - Fixes #5777
   
   ### Brief Description
   
   Invalidate the LLM runtime request generation when its effect is cleaned up. 
A configuration response arriving after leaving the AI page could still invoke 
the callback that writes the global persisted engine preference and start a 
model lookup. Late configuration/model failures could also show an obsolete 
error toast.
   
   The existing generation guard now also covers unmounting.
   
   ### How Did You Test This Change?
   
   - On the original code, all three new deferred regressions fail: the engine 
callback and both error callbacks fire after unmount.
   - `cd web; node node_modules/vitest/vitest.mjs run 
src/pages/ai/hooks/useLlmRuntime.test.ts --pool=threads --maxWorkers=1 
--reporter=dot` — 6 tests passed.
   - `cd web; node node_modules/typescript/bin/tsc -p tsconfig.app.json 
--noEmit --pretty false` — passed.
   - `cd web; node node_modules/eslint/bin/eslint.js 
src/pages/ai/hooks/useLlmRuntime.ts src/pages/ai/hooks/useLlmRuntime.test.ts` — 
passed.
   - `git diff --check` — passed.
   - Tested against `rocketmq-studio@c99b9ad50b79467546997e51f3401d57ceebea5f`. 
Full application build and backend tests were not rerun for this hook-only 
change.
   
   ### Checklist
   
   - [x] One coherent change; no unrelated modifications
   - [x] Conventional commit title
   - [x] Regression tests for the changed behavior
   - No new UI text, source files, dependencies or backend changes.
   
   ### AI Assistance
   
   AI assistance was used to inspect the asynchronous lifecycle, draft the 
patch and deferred regression cases, and run the verification commands. The 
regression cases were run against the original implementation before applying 
the fix.
   
   


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