yyqdbngt opened a new pull request, #4054:
URL: https://github.com/apache/rocketmq-dashboard/pull/4054
Fixes #3295
## Summary
Operators can now delete their own query history records. The drawer offers
a per-row delete action for both message-query and trace-query history, plus a
"clear" action that removes the current operator's history (optionally scoped
to the selected cluster) after a Popconfirm confirmation. Ownership is enforced
on the server, and the list and summary are refreshed after every deletion.
## Why
Previously query history could only be pruned by the retention sweeper, so
operators could not remove stale or mistaken entries. History is private per
operator, so deletions must never affect another operator's records.
## Testing
- Backend:
- `QueryHistoryServiceTest` covers deleting one's own record, rejecting
records owned by another operator (404 `Query history record not found`, no
delete issued), rejecting missing records, and clearing only the current
operator's rows within the requested cluster (captured SQL contains
`queried_by` and `cluster_id` conditions).
- `QueryHistoryControllerTest` covers the new `DELETE
/api/query-history/messages/{id}`, `DELETE /api/query-history/traces/{id}`,
`DELETE /api/query-history/messages?clusterId=`, and `DELETE
/api/query-history/traces?clusterId=` endpoints including filter normalization.
- Frontend (`MessageQueryHistoryDrawer.test.tsx`): deleting a message row
calls the API then reloads the page; clearing trace history asks for
confirmation and calls the clear API with the drawer's cluster; the list
reloads and the summary refreshes after both actions.
- Local type check: `./node_modules/.bin/tsc -b tsconfig.app.json` exits 0.
--
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]