@nxtedition/deepstream.io-client-js 23.1.22 → 23.1.24

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": "23.1.22",
3
+ "version": "23.1.24",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -102,11 +102,11 @@ class Record {
102
102
  return
103
103
  }
104
104
 
105
- this._emitUpdate()
106
-
107
105
  if (this._state < Record.STATE.SERVER) {
108
106
  this._handler._patch.add(this)
109
107
  }
108
+
109
+ this._emitUpdate()
110
110
  }
111
111
 
112
112
  when(stateOrNull) {
@@ -251,20 +251,20 @@ class Record {
251
251
  }
252
252
 
253
253
  _update(path, data, isPlainObject) {
254
- const prevVersion = this._version
255
254
  const prevData = this._data
256
-
257
- const nextVersion = this._makeVersion(parseInt(prevVersion || '0') + 1)
258
255
  const nextData = jsonPath.set(prevData, path, data, isPlainObject)
259
256
 
260
257
  if (nextData === prevData) {
261
258
  return false
262
259
  }
263
260
 
264
- this._version = nextVersion
265
261
  this._data = nextData
266
262
 
267
- if (this._state >= Record.STATE.SERVER) {
263
+ if (this._version) {
264
+ const prevVersion = this._version
265
+ const nextVersion = this._makeVersion(parseInt(prevVersion) + 1)
266
+ this._version = nextVersion
267
+
268
268
  const update = [this._name, nextVersion, jsonPath.stringify(data), prevVersion]
269
269
  this._handler._connection.sendMsg(C.TOPIC.RECORD, C.ACTIONS.UPDATE, update)
270
270
  this._updating ??= new Map()