-
-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Will Message is not published when client sends Disconnect Notification with Reason Code 0x04 (Disconnect with Will Message) #1291
Comments
@wlisac thanks for reporting... interesting, I think you're correct and the will message should be published in that case. |
It looks like mosquitto recently had the opposite issue – the LWT was being published on a clean disconnect. eclipse/mosquitto#1367 |
Hi, sounds like something we missed. We'll look into it. |
Hi @wlisac, I'm working on a fix for this and will hopefully have a PR ready later today. It's clear from the spec that if the client sends DISCONNECT with 0x00 normal disconnect, then the server must not send the LWT. And it's clear what the meaning is when the client sends a DISCONNECT with 0x04 Disconnect Notification with Will Message. It's not completely clear to me what should happen if the client sends a DISCONNECT with other reason codes. I'm leaning towards that the LWT should be sent then as well. If that's the case then on DISCONNECT the only case where we should not send is if the reason code is 0x00 and in all other cases we send/schedule the LWT. Does that make sense with your interpretation? |
@wlisac, would you be able to test out the PR and if it works as expected? |
@larshesel yep – I interpret it the same way. I had a chance to test out the branch and it's now working as expected, thank you! As a side note, I've noticed that the will delay interval is not working as expected, but I'm happy to open a separate issue for that. Thanks again for the quick response :) – Will |
Opened #1298 as a follow up for the Will Delay Interval. |
Environment
DOCKER_VERNEMQ_LISTENER__TCP__ALLOWED_PROTOCOL_VERSIONS=3,4,5
Expected behavior
I'm expecting the client's Will Message to be published when the client sends a Disconnect Notification with Reason Code 0x04 (Disconnect with Will Message).
Actual behaviour
The server does not publish the Will Message.
Additional Notes
Note that if the client closes the connection and doesn't send the Disconnect Notification with Reason Code 0x04, the Will Message is published.
I'm working on writing an MQTT client and I'm hoping to understand if this might be a bug in VerneMQ.
cc @larshesel
Happy to provide more details as needed.
Thanks,
Will
The text was updated successfully, but these errors were encountered: