You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using MQTT over WebSocket with QoS set to 0, I have encountered a situation where the publish callback is triggered before the message has been successfully sent. This causes the message not to get sent before the connection is ended. This issue occurs intermittently only with WebSocket connections, not with MQTT over TCP connections.
To Reproduce
Here is a simple code snippet that reproduces the issue:
constclient=// initialize MQTT client with WebSocketclient.publish(topic,message,{qos: 0},(err,packet)=>{if(err){console.error('Publish failed:',err)}else{console.log('Publish succeeded:',packet)client.end()}})
In the case of a WebSocket connection and QoS 0, the 'Publish succeeded' log may print before the message is actually sent.
Expected behavior
The publish callback should not be called until the message is successfully sent, even when using WebSocket and QoS 0.
Environment (please complete the following information):
OS: macOS
Node.js version: v16.14.2
MQTT.js version: 4.3.7
Additional context
The issue only occurs intermittently and with WebSocket connections, not other MQTT/TCP of connections.
The text was updated successfully, but these errors were encountered:
This is an automated message to let you know that this issue has
gone 365 days without any activity. In order to ensure that we work
on issues that still matter, this issue will be closed in 14 days.
If this issue is still important, you can simply comment with a
"bump" to keep it open.
Describe the bug
When using MQTT over WebSocket with QoS set to 0, I have encountered a situation where the publish callback is triggered before the message has been successfully sent. This causes the message not to get sent before the connection is ended. This issue occurs intermittently only with WebSocket connections, not with MQTT over TCP connections.
To Reproduce
Here is a simple code snippet that reproduces the issue:
In the case of a WebSocket connection and QoS 0, the 'Publish succeeded' log may print before the message is actually sent.
Expected behavior
The publish callback should not be called until the message is successfully sent, even when using WebSocket and QoS 0.
Environment (please complete the following information):
Additional context
The issue only occurs intermittently and with WebSocket connections, not other MQTT/TCP of connections.
The text was updated successfully, but these errors were encountered: