Incoming MQTT payloads are Uint8Array
Pre-release
Pre-release
- API CHANGE: Incoming MQTT payloads are now type
Uint8Array. This change affects theon_messageevent, and the topic-specific callback passed tosubscribe().- Previously, the payload type definitions claimed they were different in the event vs the callback (
Bufferfor event andArrayBufferfor callback), but in factBufferwas passed to both in the browser implementation, whileArrayBufferwas passed to both in the node implementation. Now it's consistent and correct. - Users that were doing
new Uint8Array(payload)in their code, like the samples were doing, should be unaffected (though the transformation is no longer necessary).
- Previously, the payload type definitions claimed they were different in the event vs the callback (
- API ADDITION: The MQTT
on_messageevent, and the topic-specific callback passed tosubscribe(), have addeddup,qos, andretainparams.- This is a backwards compatible change, since users are free to pass a callback that takes less params