Skip to content

Commit c5eddd1

Browse files
committed
AutorecoveringModel.IsClosed should return true if model is unusable
As per the description of [`IsClosed` on `IModel.cs`](https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/4d624be819061c9272c406a7c5250ee24eaa759f/projects/RabbitMQ.Client/client/api/IModel.cs#L85-L88), this property should "return[s] true if the model is no longer in a state where it can be used". At present this returns `false` if the `_delegate` has been disposed of - which I would say indicates that the model "is no longer in a state where it can be used". Fixes regression introduced as part of 54f7840 by aligning the behaviour of `IsClosed` with the underlying [implementation](https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/c9201e4f4ffb62206ca9c7bbca76ea68fe24345f/projects/RabbitMQ.Client/client/impl/ModelBase.cs#L161-L164) that would have been called were the delegate not disposed of.
1 parent 4e18f60 commit c5eddd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/RabbitMQ.Client/client/impl/AutorecoveringModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public IBasicConsumer DefaultConsumer
132132
set => InnerChannel.DefaultConsumer = value;
133133
}
134134

135-
public bool IsClosed => _innerChannel != null && _innerChannel.IsClosed;
135+
public bool IsClosed => !IsOpen;
136136

137137
public bool IsOpen => _innerChannel != null && _innerChannel.IsOpen;
138138

0 commit comments

Comments
 (0)