Repository navigation
Description
1. Symptom
POST /api/topics/update (TopicController.updateTopic -> ApacheInstanceProvider.updateTopic -> RocketMQAdminClientImpl.updateTopic) cannot remove a topic's stored remark.
A blank remark is accepted (HTTP 200) and the response echoes the blank value, but the rmq_instance_topic row keeps the previous remark, so the next topic list load shows the old text again. Editing a remark to a different non-blank value works; only clearing it is lost.
2. Root cause
server/src/main/java/org/apache/rocketmq/studio/provider/apache/RocketMQAdminClientImpl.java:382-384
if (StringUtils.hasText(topic.getRemark())) {
existing.setRemark(topic.getRemark());
}The cached row is only written when the submitted remark has text, so a blank submission is treated exactly like an omitted one. TopicVO.remark / UpdateTopicDTO.remark are plain nullable strings with no validation and no separate clear flag (unlike clearApiKey / clearDingtalkSigningSecret in general settings), so a blank remark is the only way a caller can express "this topic has no remark".
Clearing is a two-part problem: assigning null to the entity field would not persist either, because MyBatis-Plus updateById omits null entity fields (FieldStrategy.NOT_NULL). That mechanism is already documented and fixed for the ACL user/rule columns in #3342, and it has to be handled explicitly on this path as well.
3. Impact
- The remark column of a managed topic is write-once: it can be created and edited, never cleared. Operators have to recreate the topic or edit MySQL directly.
- The endpoint lies: the 200 response carries the cleared value while the database still holds the old one.
- The update path is the one the create dialog's edit mode is wired to (
POST /api/topics/updateis documented indocs/api-spec.md§5.4 and implemented for all three providers, andweb/src/pages/instance/topic.tsxis being wired to it in feat(topic): edit topic configuration from the topic page #4249), so the UI cannot clear a remark either.
4. Reproduction
- Create a topic with a remark, or update one to have a remark.
POST /api/topics/updatewith{"name": "<topic>", "instanceId": "<instance>", "remark": ""}.- Response: 200,
remarkis empty. - Reload the topic list (
GET /api/topics) orSELECT remark FROM rmq_instance_topic WHERE name = '<topic>': the previous remark is still there.
5. Expected behaviour
- An omitted remark (
null) keeps the stored value, which is what the existing partial-update comment inupdateTopicdescribes. - A submitted blank remark clears it (the column must become NULL).
- The response reports the persisted remark instead of the submitted one.
CreateTopicDTO/UpdateTopicDTOstay unchanged; no behavioural change for callers that submit a real remark.
Activity
RockteMQ-AI commentedon Sep 13, 2026
Issue Evaluation
Category:
bug| Status: ConfirmedThe reported issue has been verified against the current codebase.
Root Cause: Same mechanism as the admin credential ref issue — MyBatis-Plus
updateByIdusesFieldStrategy.NOT_NULLby default, which omits null entity fields from theSETclause. WhenTopicService.updateTopiccopies the incoming remark into the entity, a blank remark becomesnullafterStringUtils.isBlankcheck, andupdateByIdsilently drops the null assignment. The column retains its previous value.Impact: Operators cannot clear a topic's remark through the standard update API. The UI shows the old remark until the next reload. This is a data inconsistency issue that affects topic metadata management.
Severity: Medium — metadata inconsistency, not security-critical but affects operator workflow.
Suggested Fix: Use an
UpdateWrapperorLambdaUpdateWrapperin the repository layer to explicitly setremark = NULLwhen the incoming remark is blank. This is the same pattern needed for #4273 and the prior fixes for ACL columns (#3342).Note: This issue shares the same root cause pattern as #4273. A single fix at the repository layer (introducing a proper null-aware update strategy) could address both issues and prevent future recurrences for other nullable columns.
An automated fix proposal will be generated. Reply
/approveto proceed with PR generation.Automated evaluation by github-manager
RockteMQ-AI commentedon Sep 13, 2026
Issue Evaluation
Category:
type/bug| Status: ConfirmedThe
POST /api/topics/updateendpoint cannot clear a topic's remark because the update path treats blank values as "skip this field." This is the same class of issue as #4274 and #4273 — empty string updates are silently ignored. The fix should propagate blank values through to the underlying admin operation.Automated evaluation by github-manager
fix(topic): allow a blank update to clear the persisted topic remark
fix(topic): allow a blank update to clear the persisted topic remark (#…
github-actions commentedon Sep 21, 2026
This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.