MQTTnet icon indicating copy to clipboard operation
MQTTnet copied to clipboard

rethrow MqttClientUnexpectedDisconnectReceivedException when Publish …

Open fazho opened this issue 1 year ago • 4 comments

rethrow MqttClientUnexpectedDisconnectReceivedException when QoS is 0 and Publish errors out because server disconnects the client.

fazho avatar Apr 22 '24 17:04 fazho

@chkr1011 fyi

fazho avatar Apr 22 '24 18:04 fazho

@chkr1011 any thoughts on the concern I raised? Or if not, can you approve this PR?

fazho avatar Apr 25 '24 20:04 fazho

I will add the breaking change to the release notes. Breaking changes are happening from time to time and cannot be avoided. In this case we still get an exception. Only the the type is different now. I added a comment to the code.

chkr1011 avatar May 01 '24 18:05 chkr1011

@fazho I made the change myself and also updated the release notes and added a comment. Please let me know if you agree with the changes (especially the comment). After that I will merge the PR.

chkr1011 avatar May 04 '24 10:05 chkr1011

@chkr1011 your changes look good to me. I just made another small change, setting the default inner exception as null in the constructor of MqttClientUnexpectedDisconnectReceivedException, so that if anyone explicitly creates an MqttClientUnexpectedDisconnectReceivedException object in their code (e.g., someone might mock the MQTTClient and create this exception in their unit tests), our changes in this PR will not break it.

I know this will be a breaking change either way, but just try to make the breaking part minimum.

fazho avatar May 06 '24 17:05 fazho

@chkr1011 feel free to revert my latest change if it does not make sense to you. I am ok either way.

fazho avatar May 06 '24 22:05 fazho