@nxtedition/deepstream.io-client-js 25.0.4 → 25.1.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.
- package/package.json +2 -2
- package/src/message/connection.js +12 -6
- package/src/record/record.js +6 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/deepstream.io-client-js",
|
|
3
|
-
"version": "25.0
|
|
3
|
+
"version": "25.1.0",
|
|
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
|
@@ -392,7 +392,7 @@ class Record {
|
|
|
392
392
|
this._version = nextVersion
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
-
_onUpdate([, version, data]) {
|
|
395
|
+
_onUpdate([, version, data, hasProvider]) {
|
|
396
396
|
const prevData = this._data
|
|
397
397
|
const prevVersion = this._version
|
|
398
398
|
const prevState = this._state
|
|
@@ -425,9 +425,11 @@ class Record {
|
|
|
425
425
|
this._onPatching(false)
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
428
|
+
this._state = hasProvider != null && convertTyped(hasProvider, this._handler._client) === true
|
|
429
|
+
? C.RECORD_STATE.PROVIDER
|
|
430
|
+
: this._version.charAt(0) === 'I'
|
|
431
|
+
? C.RECORD_STATE.STALE
|
|
432
|
+
: C.RECORD_STATE.SERVER
|
|
431
433
|
|
|
432
434
|
if (this._state !== prevState || this._data !== prevData || this._version !== prevVersion) {
|
|
433
435
|
this._emitUpdate()
|