Copilot commented on code in PR #102:
URL: https://github.com/apache/activemq-nms-amqp/pull/102#discussion_r3291425371


##########
src/NMS.AMQP/Provider/Amqp/AmqpConnection.cs:
##########
@@ -115,7 +115,7 @@ internal void OnLocalOpen(Open open)
             open.ChannelMax = Info.ChannelMax;
             open.MaxFrameSize = (uint) Info.MaxFrameSize;
             open.HostName = String.IsNullOrWhiteSpace(this.Provider.VHost) ? 
remoteUri.Host : this.Provider.VHost;
-            open.IdleTimeOut = (uint) Info.IdleTimeOut;
+            open.IdleTimeOut = Info.IdleTimeOut > 0 ? (uint)Info.IdleTimeOut : 
0;

Review Comment:
   Consider adding a regression test around OnLocalOpen / idle-timeout 
negotiation to cover the cases that triggered this bug (e.g., Info.IdleTimeOut 
= -1 should result in open.IdleTimeOut = 0, and a positive value should be 
preserved). The repo already has unit tests for other AMQP provider components, 
but this edge case currently isn’t exercised and could regress silently.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to