You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chennaji9 (via GitHub)" <gi...@apache.org> on 2026/09/30 08:46:10 UTC

[PR] fix(ai): keep the active conversation open when deletion fails [rocketmq-dashboard]

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

   ### Which Issue(s) This PR Fixes
   
   None — small self-contained fix found by inspection (no issue tracked).
   
   ### Brief Description
   
   `ConversationListModal.remove` fired `onActiveDeleted` whenever the currently open conversation was in the *requested* deletion set, without checking whether its delete actually succeeded. When that delete failed, the caller still navigated away from `/ai/c/{id}` for a conversation that still exists, and the early `return` also skipped the list refresh. The callback now fires only when the active conversation is in the set and not in the `failed` array; a failed active delete falls through to the normal toast + refresh path.
   
   Base is `rocketmq-studio` per CONTRIBUTING.md (the PR template's base comment is outdated).
   
   ### How Did You Test This Change?
   
   `cd web && npx vitest run src/pages/ai/components/__tests__/ConversationListModal.test.tsx` — 21/21 pass, including the new `keepsTheOpenConversationWhenItsDeleteFailsTest` (single delete of the active conversation rejects → `onActiveDeleted` not called, error toast shown, list re-queried) and `keepsTheOpenConversationWhenOnlyItsBatchDeleteFailsTest` (batch: another row succeeds while the active one fails → warning toast, no `onActiveDeleted`, list refreshed). `npm run lint` — 0 errors.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`fix:`)
   - [x] Tests added or updated for non-trivial changes (two new component tests)
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` (n/a — reuses existing toast keys)
   - [x] Architecture constraints stay green (n/a — no Java change)
   - [x] New source files carry the ASF license header (n/a — no new source file)
   - [x] Documentation touched where behaviour changed (code comment updated)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(ai): keep the active conversation open when deletion fails [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #5211:
URL: https://github.com/apache/rocketmq-dashboard/pull/5211


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(ai): keep the active conversation open when deletion fails [rocketmq-dashboard]

Posted by "chennaji9 (via GitHub)" <gi...@apache.org>.
chennaji9 commented on PR #5211:
URL: https://github.com/apache/rocketmq-dashboard/pull/5211#issuecomment-5988153456

   Re-verified the deletion-failure path: with the old code the active conversation id was cleared even when the backend rejected the delete, leaving the UI on a still-existing conversation it could no longer address. The fix only swaps the active id after a successful delete.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org