Fix unfiltered select-all delete in admin error logs#291
Conversation
When "Select all" was active with no level/source filter, the batch delete was blocked with a confusing toast. Now falls back to sending the visible entry IDs directly instead of requiring a filter. https://claude.ai/code/session_012v1E6pJFJK1xhWH43SrACu
Move the branching logic from handleBatchDelete into a pure function buildBatchDeletePayload with 11 unit tests covering all code paths. No behavior change — pure refactor of the prior commit's fix. https://claude.ai/code/session_012v1E6pJFJK1xhWH43SrACu
Show "N visible entries" instead of "All matching entries" to avoid implying all database entries are selected when only the visible page (up to 100) is being deleted. https://claude.ai/code/session_012v1E6pJFJK1xhWH43SrACu
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes a bug where clicking "Select all" then "Delete" on the admin error logs page with no level/source filter active showed a blocking "Filter required" toast instead of performing the deletion. The fix falls back to sending the visible log entry IDs directly when no filter is active, while still using the more efficient filter-based bulk delete path when filters are set.
Changes
Bug fix (
client/src/pages/AdminErrors.tsx):ids-based delete path instead of requiring thefilters-based pathbuildBatchDeletePayloadutilityRefactor (
client/src/pages/adminErrorsUtils.ts):buildBatchDeletePayloadUX improvement (
client/src/pages/AdminErrors.tsx):Tests (
client/src/pages/adminErrorsUtils.test.ts):buildBatchDeletePayloadHow to test
/admin/errors)Server-side safety
No server changes. The server endpoint enforces:
limit=100)https://claude.ai/code/session_012v1E6pJFJK1xhWH43SrACu