@nxtedition/deepstream.io-client-js 23.4.11 → 23.4.13

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.4.11",
3
+ "version": "23.4.13",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -62,23 +62,24 @@
62
62
  "bufferutil": "^4.0.7",
63
63
  "component-emitter2": "^1.3.5",
64
64
  "invariant": "^2.2.4",
65
+ "lodash.clonedeep": "^4.5.0",
65
66
  "utf-8-validate": "^6.0.3",
66
67
  "ws": "^8.13.0",
67
68
  "xuid": "^4.1.2",
68
69
  "xxhash-wasm": "^1.0.2"
69
70
  },
70
71
  "devDependencies": {
71
- "eslint": "^8.38.0",
72
+ "eslint": "^8.42.0",
72
73
  "eslint-config-prettier": "^8.8.0",
73
- "eslint-config-standard": "^17.0.0",
74
+ "eslint-config-standard": "^17.1.0",
74
75
  "eslint-plugin-import": "^2.27.5",
75
- "eslint-plugin-n": "^15.7.0",
76
+ "eslint-plugin-n": "^16.0.0",
76
77
  "eslint-plugin-node": "^11.1.0",
77
78
  "eslint-plugin-promise": "^6.1.1",
78
79
  "husky": "^8.0.3",
79
- "lint-staged": "^13.2.1",
80
+ "lint-staged": "^13.2.2",
80
81
  "pinst": "^3.0.0",
81
- "prettier": "^2.8.7"
82
+ "prettier": "^2.8.8"
82
83
  },
83
84
  "peerDependencies": {
84
85
  "rxjs": ">=6.x"
@@ -136,10 +136,17 @@ Connection.prototype.send = function (message) {
136
136
  return
137
137
  }
138
138
 
139
- this._sendQueue.push(message)
140
- if (!this._processingSend) {
139
+ if (this._processingSend) {
140
+ this._sendQueue.push(message)
141
+ } else if (
142
+ this._state === C.CONNECTION_STATE.OPEN &&
143
+ this._endpoint.readyState === this._endpoint.OPEN
144
+ ) {
145
+ this._submit(message)
146
+ } else {
147
+ this._sendQueue.push(message)
141
148
  this._processingSend = true
142
- this._schedule(this._sendMessages)
149
+ this._sendMessages()
143
150
  }
144
151
  }
145
152
 
@@ -4,6 +4,7 @@ const C = require('../constants/constants')
4
4
  const messageParser = require('../message/message-parser')
5
5
  const xuid = require('xuid')
6
6
  const invariant = require('invariant')
7
+ const cloneDeep = require('lodash.clonedeep')
7
8
 
8
9
  class Record {
9
10
  static STATE = C.RECORD_STATE
@@ -111,7 +112,7 @@ class Record {
111
112
 
112
113
  if (!this._version) {
113
114
  this._patches = path && this._patches ? this._patches : []
114
- this._patches.push(path, jsonPath.jsonClone(data))
115
+ this._patches.push(path, cloneDeep(data))
115
116
  this._handler._patch.add(this)
116
117
  }
117
118
 
@@ -304,7 +305,7 @@ class Record {
304
305
  if (this._version.charAt(0) !== 'I') {
305
306
  let patchData = this._data
306
307
  for (let n = 0; n < this._patches.length; n += 2) {
307
- patchData = jsonPath.set(patchData, this._patches[n + 0], this._patches[n + 1], true)
308
+ patchData = jsonPath.set(patchData, this._patches[n + 0], this._patches[n + 1], false)
308
309
  }
309
310
  this._update(patchData)
310
311
  }