@nxtedition/deepstream.io-client-js 25.1.3 → 26.0.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "25.1.3",
3
+ "version": "26.0.2",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "type": "module",
@@ -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.1.0', // TODO (fix): How to read from package.json?
164
+ '26.0.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,
@@ -397,7 +397,7 @@ class Record {
397
397
  this._version = nextVersion
398
398
  }
399
399
 
400
- _onUpdate([, version, data]) {
400
+ _onUpdate([, version, data, hasProvider]) {
401
401
  const prevData = this._data
402
402
  const prevVersion = this._version
403
403
  const prevState = this._state
@@ -434,13 +434,13 @@ class Record {
434
434
  this._state = this._version.charAt(0) === 'I' ? C.RECORD_STATE.STALE : C.RECORD_STATE.SERVER
435
435
  }
436
436
 
437
- // if (hasProvider != null ) {
438
- // this._state = convertTyped(hasProvider, this._handler._client)
439
- // ? C.RECORD_STATE.PROVIDER
440
- // : this._version.charAt(0) === 'I'
441
- // ? C.RECORD_STATE.STALE
442
- // : C.RECORD_STATE.SERVER
443
- // }
437
+ if (hasProvider != null) {
438
+ this._state = convertTyped(hasProvider, this._handler._client)
439
+ ? C.RECORD_STATE.PROVIDER
440
+ : this._version.charAt(0) === 'I'
441
+ ? C.RECORD_STATE.STALE
442
+ : C.RECORD_STATE.SERVER
443
+ }
444
444
 
445
445
  if (this._state !== prevState || this._data !== prevData || this._version !== prevVersion) {
446
446
  this._emitUpdate()
@@ -40,7 +40,7 @@ class Listener {
40
40
  C.TOPIC.RECORD,
41
41
  C.EVENT.NOT_CONNECTED,
42
42
  new Error('received message while not connected'),
43
- message
43
+ message,
44
44
  )
45
45
  return
46
46
  }
@@ -102,7 +102,7 @@ class Listener {
102
102
  this._connection.sendMsg(
103
103
  this._topic,
104
104
  accepted ? C.ACTIONS.LISTEN_ACCEPT : C.ACTIONS.LISTEN_REJECT,
105
- [this._pattern, provider.key]
105
+ [this._pattern, provider.key],
106
106
  )
107
107
 
108
108
  provider.version = null
@@ -186,6 +186,7 @@ class Listener {
186
186
  } else if (message.action === C.ACTIONS.LISTEN_ACCEPT) {
187
187
  const provider = this._subscriptions.get(name)
188
188
  if (!provider?.value$) {
189
+ this._error(name, 'invalid accept: listener missing')
189
190
  return
190
191
  }
191
192
 
@@ -222,7 +223,7 @@ class Listener {
222
223
  this._client._$onError(this._topic, C.EVENT.LISTENER_ERROR, err, [
223
224
  this._pattern,
224
225
  name,
225
- this._handler.getKey(name),
226
+ this._handler.getKey(name).toString(),
226
227
  ])
227
228
  }
228
229
 
@@ -18,7 +18,7 @@ const PIPE = rxjs.pipe(
18
18
 
19
19
  return data
20
20
  }),
21
- rx.distinctUntilChanged()
21
+ rx.distinctUntilChanged(),
22
22
  )
23
23
 
24
24
  class Listener {
@@ -116,7 +116,11 @@ class Listener {
116
116
  }
117
117
 
118
118
  _error(name, err) {
119
- this._client._$onError(this._topic, C.EVENT.LISTENER_ERROR, err, [this._pattern, name])
119
+ this._client._$onError(this._topic, C.EVENT.LISTENER_ERROR, err, [
120
+ this._pattern,
121
+ name,
122
+ this._handler.getKey(name).toString(),
123
+ ])
120
124
  }
121
125
 
122
126
  _reset() {