lizhimins commented on PR #5779: URL: https://github.com/apache/rocketmq-dashboard/pull/5779#issuecomment-6093315220
> Thanks — the defect is real and the fix is the right one: after unmount `optionsRef.current` still holds the last render's callbacks, so `useLlmRuntime.ts:108` writes the globally persisted engine preference and line 113 fires an extra `getLlmModels()` request. Reusing the existing `loadSeqRef` generation guard in the effect cleanup is minimal and correct, and the three deferred regressions are mutation-sensitive. > > The blocker is not technical: #5782 fixes the same issue (#5777) and the two branches genuinely conflict in `web/src/pages/ai/hooks/useLlmRuntime.test.ts`. #5782 also adds a page-level regression in `AiPage.test.tsx` that pins the persisted-store overwrite itself. We will pick one of the two and close the other with a pointer — no action needed from you until then. > > Optional follow-up (not required for this PR): 15 files use the same `requestId = useRef(0)` generation pattern and only `useConversationTimeline.ts` has an unmount cleanup. The rest only call `s etState` after unmount, which React 18 makes harmless, but `useConversationList.ts` and the `onError` call sites in `useAgentRun.ts` (lines 275/356/408) are worth a separate pass. --- **Decision**: we are taking #5782 for this defect - it covers the unmount dimension on a newer baseline and its cases include the StrictMode and integration-level paths. Closing this one as a duplicate. Thanks for finding it independently; the fix lands through #5782 and your analysis above is recorded there. -- 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]
