vrpc 3.10.1 → 3.11.0

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.
@@ -1,10 +1,11 @@
1
- /*!
2
- * The buffer module from node.js, for the browser.
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */
1
+ /*! Bundled license information:
7
2
 
8
- /*! https://mths.be/punycode v1.4.1 by @mathias */
3
+ @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
4
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
9
5
 
10
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
6
+ safe-buffer/index.js:
7
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
8
+
9
+ @babel/runtime/helpers/regenerator.js:
10
+ (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
11
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vrpc",
3
- "version": "3.10.1",
3
+ "version": "3.11.0",
4
4
  "description": "Variadic Remote Procedure Calls",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -74,7 +74,7 @@
74
74
  "buffer": "^6.0.3",
75
75
  "caller": "^1.1.0",
76
76
  "json-stringify-safe": "^5.0.1",
77
- "mqtt": "^4.3.7",
77
+ "mqtt": "^5.16.0",
78
78
  "nanoid": "^3.3.8",
79
79
  "process": "^0.11.10"
80
80
  },
package/vrpc/VrpcAgent.js CHANGED
@@ -187,6 +187,10 @@ class VrpcAgent extends EventEmitter {
187
187
  password,
188
188
  keepalive: 30,
189
189
  connectTimeout: 10 * 1000,
190
+ // a refused CONNACK is retried like any other failed attempt: an
191
+ // authorization service that is briefly away refuses, too, and an
192
+ // agent must come back when it does (mqtt >= 5 stops otherwise)
193
+ reconnectOnConnackError: true,
190
194
  clientId: this._mqttClientId,
191
195
  rejectUnauthorized: false,
192
196
  will: {
@@ -68,7 +68,7 @@ class VrpcClient extends EventEmitter {
68
68
  * @param {Boolean} [options.bestEffort=true] If true, message will be sent with best effort, i.e. no caching if offline
69
69
  * @param {String} [options.mqttClientId='<generated()>'] Explicitly sets the mqtt client id
70
70
  * @param {String} [options.identity] Explicitly sets a vrpc client identity
71
- * @param {String} [options.keepalive] Sets the MQTT keepalive interval (in seconds)
71
+ * @param {String} [options.keepalive] Sets the MQTT keepalive interval (in seconds). In browsers the ping runs on a Web Worker timer, so a hidden tab keeps its session
72
72
  * @param {Boolean} [options.requiresSchema=false] If true, any available schema information is shipped
73
73
  * @example
74
74
  * const client = new VrpcClient({
@@ -231,6 +231,9 @@ class VrpcClient extends EventEmitter {
231
231
  clientId: this._mqttClientId,
232
232
  rejectUnauthorized: false,
233
233
  connectTimeout: this._timeout,
234
+ // a refused CONNACK is retried like any other failed attempt (see
235
+ // VrpcAgent): whoever wants a refusal to be final ends the client
236
+ reconnectOnConnackError: true,
234
237
  will: {
235
238
  topic: `${this._vrpcConnectionId}/__clientInfo__`,
236
239
  payload: JSON.stringify({