X-LightYear opened a new issue, #6331:
URL: https://github.com/apache/rocketmq-dashboard/issues/6331
## Problem
The supported frontend Mock mode reports successful deletion when a selected
Topic, Consumer Group, or alert rule no longer exists. The corresponding REST
paths reject the same stale or missing resource instead of treating the
operation as a no-op.
## Reproduction
With the frontend running in Mock mode, call the service-layer delete
operation with an identifier that is not present in the mock store:
```text
deleteTopic("__missing_topic__", "instance-proxy-1")
deleteConsumerGroup("__missing_group__", "instance-proxy-1")
deleteAlertRule(Number.MIN_SAFE_INTEGER)
```
These calls are reached by the Topic, Consumer Group, and alert-rule delete
actions. A stale row in another tab, a repeated confirmation before a refresh,
or an already-removed record can produce this state.
## Expected behavior
Each operation should reject the missing resource, matching the REST
contract and the existing Mock service behavior for missing Instance, ACL,
certificate, NameServer, and update records. The page should then report the
delete failure and keep the stale selection actionable for refresh/retry
handling.
## Actual behavior
All three Mock operations resolve `undefined` without changing the store.
The page can therefore show a successful delete result even though no resource
was deleted; batch Topic/Consumer Group callers also classify the missing name
as `deleted` rather than `failed`.
## Root cause
The Mock branches in `web/src/services/topicService.ts`,
`consumerService.ts`, and `opsService.ts` only splice when a matching index
exists and unconditionally return otherwise. They do not perform the
missing-record check implemented by the corresponding REST paths.
## Scope
Frontend Mock-mode service contract parity for Topic, Consumer Group, and
alert-rule deletion. This is not a security issue and does not change provider
behavior.
## Regression evidence
On the latest `rocketmq-studio` commit
`7ec3dda8d20fc303d133c7f3ffd80bce9efa4a07`, a temporary Vitest probe with three
`rejects.toThrow()` assertions failed deterministically:
```text
Test Files 1 failed (1)
Tests 3 failed (3)
promise resolved "undefined" instead of rejecting
```
The adjacent existing service tests passed: 3 files, 44 tests.
## Duplicate review
- #920 / #921 cover missing Mock Instance deletion only.
- #6043 covers missing Mock ACL rule/user deletion only.
- #1034 covers persisted backend Alert/ACL deletion, not the frontend Mock
alert-rule branch.
- #924 consolidates earlier Mock contract fixes but does not modify these
three delete paths.
This report extends the same established contract-hardening pattern to
distinct, still-unfixed service paths.
--
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]