Copilot commented on code in PR #4581:
URL:
https://github.com/apache/rocketmq-dashboard/pull/4581#discussion_r4056326697
##########
server/src/main/java/org/apache/rocketmq/studio/provider/apache/RocketMQAdminClientImpl.java:
##########
@@ -359,11 +361,11 @@ public TopicVO updateTopic(String instanceId, TopicVO
topic) {
// Preserve the existing queue counts when the update request
does not change them,
// matching the perm semantics below; defaulting to 8 would
silently resize the
// topic on partial updates (e.g. perm or remark only).
- int writeQueues = topic.getWriteQueues() > 0
+ int writeQueues = topic.getWriteQueues() != null &&
topic.getWriteQueues() >= 0
? topic.getWriteQueues()
: existing != null && existing.getWriteQueueNums() !=
null
&& existing.getWriteQueueNums() > 0 ?
existing.getWriteQueueNums() : 8;
Review Comment:
An explicit zero can now be persisted here, but the fallback still treats a
stored `0` as absent (`> 0`) and changes it to 8 on the next update that omits
`writeQueues`. That contradicts the partial-update preservation behavior;
accept a stored zero by changing this check to `>= 0`.
This issue also appears on line 368 of the same file.
--
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]