unbridled-41 opened a new pull request, #5895:
URL: https://github.com/apache/rocketmq-dashboard/pull/5895

   ### Which Issue(s) This PR Fixes
   
   Fixes #5894
   
   ### Problem / Evidence
   
   `GET /audit-logs/export` deterministically refuses a filtered result set 
above 10000 rows with the remedy in the body:
   
   ```java
   // server/.../ops/audit/AuditService.java:82-84
   throw new BusinessException(400,
       "Audit log export exceeds the maximum of " + MAX_EXPORT_RECORDS + " 
records; narrow the filters");
   ```
   
   The page discarded it:
   
   ```ts
   // web/src/pages/ops/audit.tsx:309 (before)
   } catch {
     message.error('导出审计日志失败,请稍后重试');
   }
   ```
   
   so the toast told the operator to try again later for a request that can 
never succeed, and the one actionable fact the server sent - narrow the filters 
- never reached the screen. Every product write is audited (topic, group, ACL, 
settings, cloud instance, ...), so the cap is reached routinely, and after that 
the Export button is permanently unusable with a misleading message.
   
   ### Root cause / Fix
   
   A `catch` without the error object, on a path whose failure carries a server 
reason. Use the shared `describeApiError` extractor already used by 
`pages/ops/alerts.tsx` (rule import conflicts) and `pages/instance/index.tsx`, 
falling back to the existing string when the failure carries no server message.
   
   ### Priority and scoring
   
   **PRIORITY 46** — impact 18/40 (a page action permanently broken and 
mis-explained, with no workaround discoverable from the UI), blast radius 12/20 
(needs an audit table above the cap, which every long-lived deployment 
reaches), reproducibility 16/20 (deterministic once above the cap; pinned by 
the new test), maintenance value 8/20 (the shared helper already exists).
   
   **FIX_CONFIDENCE 92** — same pattern as two sibling pages, one-line change 
plus a test.
   
   ### Tests
   
   `cd web && npx vitest run src/pages/ops/__tests__/AuditPage.test.tsx`
   
   | Test | Before | After |
   |---|---|---|
   | `surfaces the export cap instead of telling the user to retry` | FAIL 
`Unable to find an element with the text: /narrow the filters/` | PASS |
   
   `Test Files 1 passed (1), Tests 12 passed (12)`. `npx eslint` on both files 
reports no errors; `npx tsc -b` passes.
   
   ### Risk
   
   None beyond the message text: the success path, the download and the export 
payload are untouched, and an error without a server message keeps the previous 
wording. The hardcoded fallback string stays as it is, so this does not collide 
with the i18n work tracked for this page.
   


-- 
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]

Reply via email to