@nxtedition/deepstream.io-client-js 25.0.4 → 25.1.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.
- package/package.json +2 -2
- package/src/message/connection.js +12 -6
- package/src/record/record.js +11 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/deepstream.io-client-js",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.1.1",
|
|
4
4
|
"description": "the javascript client for deepstream.io",
|
|
5
5
|
"homepage": "http://deepstream.io",
|
|
6
6
|
"type": "module",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"xxhash-wasm": "^1.0.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"eslint": "^
|
|
74
|
+
"eslint": "^8.0.0",
|
|
75
75
|
"eslint-config-prettier": "^9.1.0",
|
|
76
76
|
"eslint-config-standard": "^17.1.0",
|
|
77
77
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -161,7 +161,7 @@ Connection.prototype._sendAuthParams = function () {
|
|
|
161
161
|
this._setState(C.CONNECTION_STATE.AUTHENTICATING)
|
|
162
162
|
const authMessage = messageBuilder.getMsg(C.TOPIC.AUTH, C.ACTIONS.REQUEST, [
|
|
163
163
|
this._authParams,
|
|
164
|
-
'25.
|
|
164
|
+
'25.1.0', // TODO (fix): How to read from package.json?
|
|
165
165
|
utils.isNode
|
|
166
166
|
? `Node/${process.version}`
|
|
167
167
|
: globalThis.navigator && globalThis.navigator.userAgent,
|
|
@@ -313,7 +313,7 @@ Connection.prototype._handleConnectionResponse = function (message) {
|
|
|
313
313
|
} else if (message.action === C.ACTIONS.CHALLENGE) {
|
|
314
314
|
this._setState(C.CONNECTION_STATE.CHALLENGING)
|
|
315
315
|
this._submit(
|
|
316
|
-
messageBuilder.getMsg(C.TOPIC.CONNECTION, C.ACTIONS.CHALLENGE_RESPONSE, [this._url])
|
|
316
|
+
messageBuilder.getMsg(C.TOPIC.CONNECTION, C.ACTIONS.CHALLENGE_RESPONSE, [this._url]),
|
|
317
317
|
)
|
|
318
318
|
} else if (message.action === C.ACTIONS.REJECTION) {
|
|
319
319
|
this._challengeDenied = true
|
|
@@ -381,10 +381,16 @@ Connection.prototype._tryReconnect = function () {
|
|
|
381
381
|
|
|
382
382
|
if (this._reconnectionAttempt < this._options.maxReconnectAttempts) {
|
|
383
383
|
this._setState(C.CONNECTION_STATE.RECONNECTING)
|
|
384
|
-
this._reconnectTimeout = setTimeout(
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
384
|
+
this._reconnectTimeout = setTimeout(
|
|
385
|
+
() => {
|
|
386
|
+
this._reconnectTimeout = null
|
|
387
|
+
this._createEndpoint()
|
|
388
|
+
},
|
|
389
|
+
Math.min(
|
|
390
|
+
this._options.maxReconnectInterval,
|
|
391
|
+
this._options.reconnectIntervalIncrement * this._reconnectionAttempt,
|
|
392
|
+
),
|
|
393
|
+
)
|
|
388
394
|
this._reconnectionAttempt++
|
|
389
395
|
} else {
|
|
390
396
|
this._clearReconnect()
|
package/src/record/record.js
CHANGED
|
@@ -251,7 +251,7 @@ class Record {
|
|
|
251
251
|
onDone(
|
|
252
252
|
Object.assign(new Error(`timeout ${this.name} [${current}<${expected}]`), {
|
|
253
253
|
code: 'ETIMEDOUT',
|
|
254
|
-
})
|
|
254
|
+
}),
|
|
255
255
|
)
|
|
256
256
|
}, timeout)
|
|
257
257
|
}
|
|
@@ -429,6 +429,14 @@ class Record {
|
|
|
429
429
|
this._state = this._version.charAt(0) === 'I' ? C.RECORD_STATE.STALE : C.RECORD_STATE.SERVER
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
+
// if (hasProvider != null ) {
|
|
433
|
+
// this._state = convertTyped(hasProvider, this._handler._client)
|
|
434
|
+
// ? C.RECORD_STATE.PROVIDER
|
|
435
|
+
// : this._version.charAt(0) === 'I'
|
|
436
|
+
// ? C.RECORD_STATE.STALE
|
|
437
|
+
// : C.RECORD_STATE.SERVER
|
|
438
|
+
// }
|
|
439
|
+
|
|
432
440
|
if (this._state !== prevState || this._data !== prevData || this._version !== prevVersion) {
|
|
433
441
|
this._emitUpdate()
|
|
434
442
|
}
|
|
@@ -473,8 +481,8 @@ class Record {
|
|
|
473
481
|
hasProvider && convertTyped(hasProvider, this._handler._client)
|
|
474
482
|
? C.RECORD_STATE.PROVIDER
|
|
475
483
|
: this._version.charAt(0) === 'I'
|
|
476
|
-
|
|
477
|
-
|
|
484
|
+
? C.RECORD_STATE.STALE
|
|
485
|
+
: C.RECORD_STATE.SERVER
|
|
478
486
|
|
|
479
487
|
if (this._state !== prevState) {
|
|
480
488
|
this._emitUpdate()
|