iloveeyjafjalla opened a new issue, #6418: URL: https://github.com/apache/rocketmq-dashboard/issues/6418
### Before Creating the Bug Report - [x] Searched current all-state Issues/PRs and read relevant full comments and actual head differences. - [x] This is a RocketMQ Studio frontend defect, with exact source and reproduction limits below. ### Studio Version `rocketmq-studio` at `779b8c0e7aed2396d3cc72743dcd544ea48e9ae6`, from source using the existing component test harness. ### Runtime Environment / Connected RocketMQ Cluster Local Windows, Node 24.15.0, npm 11.12.1, Vitest/jsdom. The real AiPage, Composer, input and template controls are rendered. The failure is controlled at the normal conversation-creation API boundary; other service calls use the existing test fixtures. No live RocketMQ cluster, model provider, MySQL or deployed browser session was used for the regression. ### Describe the Bug A failed conversation creation restores its submitted prompt even when the operator has since written a new unsent draft on the same `/ai` page. The failed old request overwrites that newer input. Deliberately clearing newly typed input or applying a template is also overwritten. ### Steps to Reproduce 1. On `/ai` with the composer ready, enter and send A. 2. Keep the conversation-creation request pending. The composer clears A and remains editable. 3. Type unsent B, or apply a built-in template. Alternatively type B and deliberately clear it. 4. Let creation fail through its ordinary error response. 5. Observe the error and the textarea replaced with A. The added `preservesNewerDraftAfterConversationCreationFailsTest` cases in the linked PR reproduce these steps through actual page controls. With unchanged production, all three newer-edit cases fail at the textarea assertion; the no-edit restore control passes. ### Expected / Actual Expected: preserve newer user input, including an intentional empty draft. If no edit occurred, restore A as before. Actual: A unconditionally overwrites the current draft when the old creation callback returns null. ### Additional Context The current `AiPage.handleSend` restores captured text without checking whether the draft changed during its await. This is distinct from #4739/#4740's refused-send admission, #5454's duplicate-creation guard and #5787's route abandonment. Their actual related patches were read; this report concerns editing on the same route after one submission. The proposed fix captures a draft revision after the Composer consumes A and restores only while that revision still owns the draft. Focused regressions 4/4 and complete AiPage/Composer/Home suites 52/52 pass, as do lint (0 errors, 10 existing warnings), production build/license and formatting. No full frontend/backend or remote CI pass is claimed. AI assistance (Codex) was used; the actual diff and evidence received independent review. ### Are You Willing to Submit a Pull Request? - [x] Yes: https://github.com/apache/rocketmq-dashboard/pull/6417 -- 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]
