masohi-mqtt 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,8 +20,12 @@ async function afterBoot () {
20
20
  if (evt === 'message') {
21
21
  path = 'data'
22
22
  source += `:${args[0]}` // see above format, args[0] is MQTT topic
23
- payload = args[1]
24
- if (conn.payloadType === 'json') payload = JSON.parse(payload.toString())
23
+ payload = args[1].toString()
24
+ if (conn.payloadType === 'json') {
25
+ try {
26
+ payload = JSON.parse(payload.toString())
27
+ } catch (err) {}
28
+ }
25
29
  } else if (evt === 'error') {
26
30
  error = args[0]
27
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "masohi-mqtt",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "MQTT binding for Masohi Messaging",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-25
4
+
5
+ - [2.2.1] Bug fix on ```onMessage``` event
6
+
3
7
  ## 2026-01-29
4
8
 
5
9
  - [2.2.0] Change to hook ```bajo:afterBoot```