iloveeyjafjalla opened a new pull request, #6280: URL: https://github.com/apache/rocketmq-dashboard/pull/6280
### Which Issue(s) This PR Fixes The accompanying bug report will be linked immediately after PR creation. ### Brief Description After an operator sees their live question and answer, scrolls up, and the run finishes, the AI thread incorrectly reports one new unread message when those same messages become persisted history. `ChatThread` omits the optimistic user bubble from its count, although `BubbleList` already displays it. Count the same messages that BubbleList renders: persisted bubbles, the nonblank optimistic question, and the live assistant including its initial waiting placeholder. Their normal replacement by persisted messages keeps the count stable; actual new messages still increase it. ### How Did You Test This Change? Baseline: `rocketmq-studio@5e4c39b053c35a5598cc79ff331b8a54e649d7b1`. Windows 11, Node 24.15.0, npm 11.12.1; separate LF worktree with the existing npm-ci dependencies shared through a local junction. - Old production code: both new regressions fail. The real AiPage send/scroll/stream/timeline lifecycle ends with an incorrect `1 条新消息` badge. The real ChatThread renders a pending question and waiting answer but fails to count them as two arriving messages. - `npm test -- --maxWorkers=1 src/pages/ai/__tests__/AiPage.test.tsx src/pages/ai/components/__tests__/ChatThread.test.tsx`: 32/32 passed after the fix, including existing token, batch-arrival, removal, scroll/reset and navigation controls. - `npm run lint`: exit 0, 0 errors and 10 warnings in untouched files. Changed-file ESLint, Prettier and `git diff --check` passed. - `npm run build`: passed, including the license gate (133 components, 140 legal files). - `npm test -- --maxWorkers=4`: 153/153 files and 1519/1519 tests passed (566.40 seconds). The page regression uses the real AiPage hooks and rendering, with controlled stream/timeline responses and the existing scroll-metric test technique. It verifies the live messages were already visible before scrolling and that their final persisted copies occur exactly once. No model provider, broker, database or deployment was contacted; Java and Go checks were not run for this frontend-only change. AI assistance: OpenAI Codex helped investigate, implement and verify this change. Separate automated agents reviewed the normal lifecycle, current duplicate evidence and the actual diff/regression results. No human or maintainer approval is claimed. ### Checklist - [x] One coherent fix and its tests - [x] Conventional Commit subject - [x] Real page and rendered-component regressions, names end in `Test` - [x] New UI text: N/A - [ ] Java architecture/integration tests: not run, no backend change - [x] Existing ASF headers retained; no new source file - [x] Documentation: N/A, restores the existing unread-message contract -- 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]
