tju-yxq opened a new issue, #2422:
URL: https://github.com/apache/rocketmq-dashboard/issues/2422

   ## Problem
   
   `MetadataService` validates and trims names at the service boundary for most 
topic operations, but `deleteTopic` is the exception:
   
   ```java
   public void deleteTopic(String instanceId, String name) {
       instanceId = normalizeInstanceId(instanceId);
       resolve(instanceId).deleteTopic(instanceId, name);
   }
   ```
   
   The HTTP DTO rejects a fully blank name, but it does not trim input, and the 
service method can also be called directly. Current consequences:
   
   - a name such as `" orders "` reaches Apache, Tencent, and Aliyun providers 
without trimming;
   - the Apache path can run broker/NameServer deletion and local metadata 
cleanup with the untrimmed name;
   - cloud providers receive the untrimmed value in `DeleteTopicRequest`;
   - inconsistent with sibling methods in the same service, which use 
`requireName(...)` and pass the normalized value onward.
   
   The controller test only covers a missing or fully blank name. It does not 
cover whitespace-padded names or the service boundary.
   
   ## Expected behavior
   
   `deleteTopic` should behave like the other metadata operations:
   
   - reject a null/blank topic name with the existing `400 topic name is 
required` response;
   - trim the name once;
   - pass the normalized name to the selected provider;
   - preserve current provider routing, deletion semantics, audits, and 
instance normalization.
   
   ## Suggested tests
   
   - direct service call with `" "` returns 400 before provider resolution;
   - direct service call with `" orders "` delegates with `"orders"`;
   - controller path still rejects missing/blank names;
   - provider is never called with an untrimmed or blank name.
   
   This is a small service-boundary consistency fix rather than a broad 
refactor.


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