messere1 opened a new pull request, #6042:
URL: https://github.com/apache/rocketmq-dashboard/pull/6042
### Which Issue(s) This PR Fixes
- Resubmission of #1924 (closed during the August branch-rebase sweep, with
an invitation to resubmit against the current branch). Original report: #1917,
closed as not planned — the defect is still present on the current
`rocketmq-studio` tip.
### Brief Description
In mock mode, `exportAlertRuleAsset()` converted a failed lookup into an
**empty** YAML `Blob`, so exporting a stale/unknown asset silently downloaded
an empty file. The preview path (`getAlertRuleAsset`) and the real server
contract (`GET /alert-rule-assets/{name}/export`, which answers 404 for unknown
names) both surface not-found.
Consolidate both mock paths on one fail-fast lookup that throws for unknown
assets, and cover the export case with a regression test.
### How Did You Test This Change?
```text
$ cd web && npx vitest run src/services/alertRuleAssetService.test.ts
Test Files 1 passed (1)
Tests 9 passed (9)
$ npx eslint src/services/alertRuleAssetService.ts
src/services/alertRuleAssetService.test.ts # clean
```
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated for non-trivial changes
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(no new UI text)
- [x] Architecture constraints stay green (frontend mock layer only)
- [x] New source files carry the ASF license header (no new files)
- [x] Documentation touched where behaviour changed (mock now matches the
documented 404 contract)
--
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]