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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]