MQTTnet
MQTTnet copied to clipboard
incorrect behaviour of IMqttServerClientMessageQueueInterceptor
Describe the bug
incorrect behaviour of MqttClientMessageQueueInterceptorContext.AcceptEnqueue
Which project is your bug related to?
- Server
To Reproduce
Steps to reproduce the behavior:
setting MqttClientMessageQueueInterceptorContext.AcceptEnqueue flag to false
, stops client message queue processing
Expected behavior
MqttClientMessageQueueInterceptorContext.AcceptEnqueue should control sending specific message to specific client only
Additional context / logging
https://github.com/chkr1011/MQTTnet/blob/8f1d4e3c22f3226570eec681bccef3a88c4ebd16/Source/MQTTnet/Server/MqttClientConnection.cs#L424
as we can see, return
is called once context.AcceptEnqueue == false
that stops
https://github.com/chkr1011/MQTTnet/blob/8f1d4e3c22f3226570eec681bccef3a88c4ebd16/Source/MQTTnet/Server/MqttClientConnection.cs#L385
which was started at https://github.com/chkr1011/MQTTnet/blob/8f1d4e3c22f3226570eec681bccef3a88c4ebd16/Source/MQTTnet/Server/MqttClientConnection.cs#L172
Possible fix
if (!context.AcceptEnqueue || context.ApplicationMessage == null)
continue;
Thank you for reporting this issue and providing a solution. Unfortunately, the code has changed so that the fix is no longer needed.