mqtt 5.10.1 → 5.10.3

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mqtt",
3
3
  "description": "A library for the MQTT protocol",
4
- "version": "5.10.1",
4
+ "version": "5.10.3",
5
5
  "contributors": [
6
6
  "Adam Rudd <adamvrr@gmail.com>",
7
7
  "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
@@ -63,9 +63,9 @@
63
63
  "build:browser": "node esbuild.js",
64
64
  "build": "npm run build:ts && npm run build:browser",
65
65
  "prepare": "npm run build",
66
- "unit-test:node": "node_modules/.bin/nyc node -r esbuild-register test/runTests.ts",
66
+ "unit-test:node": "node -r esbuild-register --test-concurrency 4 --test-reporter=junit --test-reporter-destination=junit.xml --test-reporter=spec --test-reporter-destination=stdout --test test/node/*.ts ",
67
67
  "unit-test:browser": "wtr",
68
- "test:node": "npm run unit-test:node && codecov",
68
+ "test:node": "node_modules/.bin/nyc npm run unit-test:node",
69
69
  "test:browser": "npm run build && npm run unit-test:browser",
70
70
  "test": "npm run test:node",
71
71
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
@@ -95,6 +95,9 @@
95
95
  }
96
96
  }
97
97
  },
98
+ "publishConfig": {
99
+ "provenance": true
100
+ },
98
101
  "pre-commit": [
99
102
  "lint"
100
103
  ],
@@ -116,7 +119,7 @@
116
119
  "help-me": "^5.0.0",
117
120
  "lru-cache": "^10.0.1",
118
121
  "minimist": "^1.2.8",
119
- "mqtt-packet": "^9.0.0",
122
+ "mqtt-packet": "^9.0.1",
120
123
  "number-allocator": "^1.0.14",
121
124
  "readable-stream": "^4.4.2",
122
125
  "reinterval": "^1.1.0",
@@ -139,7 +142,6 @@
139
142
  "aedes-cli": "^0.8.0",
140
143
  "chai": "^4.3.10",
141
144
  "chokidar": "^3.5.3",
142
- "codecov": "^3.8.2",
143
145
  "conventional-changelog-cli": "^4.1.0",
144
146
  "end-of-stream": "^1.4.4",
145
147
  "esbuild": "^0.19.5",
package/src/lib/client.ts CHANGED
@@ -162,6 +162,12 @@ export interface IClientOptions extends ISecureClientOptions {
162
162
  * 1000 milliseconds, interval between two reconnections
163
163
  */
164
164
  reconnectPeriod?: number
165
+ /**
166
+ * Set to true to enable the reconnect period to apply if the initial
167
+ * connection is denied with an error in the CONNACK packet, such as with an
168
+ * authentication error.
169
+ */
170
+ reconnectOnConnackError?: boolean
165
171
  /**
166
172
  * 30 * 1000 milliseconds, time to wait before a CONNACK is received
167
173
  */
@@ -49,6 +49,9 @@ const handleConnack: PacketHandler = (client, packet: IConnackPacket) => {
49
49
  rc,
50
50
  )
51
51
  client.emit('error', err)
52
+ if (client.options.reconnectOnConnackError) {
53
+ client['_cleanUp'](true)
54
+ }
52
55
  }
53
56
  }
54
57