You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/10/09 16:35:04 UTC
[PR] fix(audit): surface the export cap instead of advising a retry that cannot work [rocketmq-dashboard]
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(audit): surface the export cap instead of advising a retry that cannot work [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #5895:
URL: https://github.com/apache/rocketmq-dashboard/pull/5895
--
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(audit): surface the export cap instead of advising a retry that cannot work [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5895:
URL: https://github.com/apache/rocketmq-dashboard/pull/5895#issuecomment-6085853324
### CI status of this PR
`Backend Tests (Java 21)` — **pass**; the change-specific commands and their results are in the Tests section of the description.
The four remaining red jobs are red for every branch, including `rocketmq-studio` itself:
- `Backend Build (Java 21)` — the `binary-license-gate` antrun step fails on a list of third-party jars (`spring-ai-*`, `swagger-ui`, `tencentcloud-sdk-*`, `zstd-jni`, ... : "missing complete upstream LICENSE/COPYING; a POM name or link is not a substitute"). This PR touches no build configuration; tracked by #5341.
- `Frontend Build (Node 20)` / `Frontend Docker Build` — the frontend licence manifest check fails the same way on branches that do not touch `web/` at all; tracked by #5346.
- `rmqctl Build (Go)` — `cmd` `TestMessageQueryCompletenessWarningTest` yaml subtests: `got {"items":[{"size":"3","storeTime":"1",...}]}, want {"size":3,"storeTime":1,...}`, i.e. the YAML renderer writes numbers as quoted strings where the test expects integer literals. Reproduced locally with `cd rmqctl && go test ./cmd/` from a checkout whose `rmqctl/` tree is byte-identical to `rocketmq-studio`'s (this PR does not touch the CLI), and already owned by open PR #5850 ("keep yaml numbers unquoted").
--
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(audit): surface the export cap instead of advising a retry that cannot work [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5895:
URL: https://github.com/apache/rocketmq-dashboard/pull/5895#issuecomment-6091132018
### Description corrected: the reason did reach the screen, the contradiction is the defect
Reviewing this PR's premise I overstated one point, and the description now says it precisely: `web/src/api/client.ts` already toasts the server's business message (`message.error(getBusinessError(error.response?.data))` before rethrowing), so in a browser the operator *does* see "Audit log export exceeds the maximum of 10000 records; narrow the filters". What the page adds on top is the wrong advice — `导出审计日志失败,请稍后重试` — as the last toast on screen.
The fix is unchanged and still correct: the page should carry the reason itself and must not tell the operator to retry a request that deterministically fails. The Problem/Evidence and impact sections of the description were updated accordingly; the code, tests and evidence in the PR are unaffected (the test drives the page with a rejected axios-shaped error, which is exactly the path the page now handles).
No new commit: this is a description-only correction.
--
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(audit): surface the export cap instead of advising a retry that cannot work [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5895:
URL: https://github.com/apache/rocketmq-dashboard/pull/5895#issuecomment-6091308622
### Verification on the final commit (branch + commit + command results)
Every command from the description re-run on a fresh worktree of this branch (`git worktree add <dir> fork/<branch>`, no local modifications), at commit `323f3e2f1f`:
| command | exit | result |
| --- | --- | --- |
| `cd web && npx vitest run src/pages/ops/__tests__/AuditPage.test.tsx` | 0 | `Test Files 1 passed (1) · Tests 12 passed (12)` |
CI note: on this repository the `Backend Build` (binary-license-gate), `Frontend Build` / `Frontend Docker Build` (licence manifest) and `rmqctl Build` (YAML renderer quoting) jobs are red for every branch, trunk included; the module-level commands above are unaffected.
--
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(audit): surface the export cap instead of advising a retry that cannot work [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5895:
URL: https://github.com/apache/rocketmq-dashboard/pull/5895#issuecomment-6268052698
Rebased the branch on the current `rocketmq-studio` (merge commit `104b1b07`) to clear the import conflict in `web/src/pages/ops/audit.tsx`.
Resolution: keep `describeApiError` (this PR) and the base branch's switch from `formatDateTime` to `formatUtcDateTime` for the timestamp column.
Verified at `104b1b07`: `npx vitest run src/pages/ops/__tests__/AuditPage.test.tsx` → 17 tests, 0 failures.
--
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