Skip to content

MQTT on-message callbacks carry more info + Bugfixes

Choose a tag to compare

@graebm graebm released this 20 Feb 07:35
· 243 commits to main since this release
a88cc63
  • IMPROVEMENT: The MQTT on_message event, and the topic-specific callback passed to subscribe(), have added dup, qos, and retain params.
  • IMPROVEMENT: Outgoing MQTT Payload type now accepts ArrayBuffer and any ArrayBufferView (ex: Uint8Array) type.
  • BUGFIX: on_message payload typescript signature changed from Buffer to ArrayBuffer.
    • This is a semi-breaking change. There were two callback passing payloads, one signature claimed to pass ArrayBuffer payloads and the other claimed to pass Buffer payloads. In reality the node implementation always passed ArrayBuffer and the browser implementation always passed Buffer. Now, both callbacks share a signature, they both claim to pass ArrayBuffer and both the node and browser implementations actually do pass ArrayBuffer
  • BUGFIX: browser MQTT publish() no longer tries to turn everything to strings. ArrayBuffer and ArrayBufferView types will pass their bytes straight through.
  • BUGFIX: browser MQTT unsubscribe()