@nxtedition/deepstream.io-client-js 23.3.2 → 23.3.4
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 +1 -1
- package/src/client.js +8 -2
- package/src/record/record.js +2 -7
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -71,7 +71,11 @@ Client.prototype.getConnectionState = function () {
|
|
|
71
71
|
|
|
72
72
|
Client.prototype._$onMessage = function (message) {
|
|
73
73
|
if (this._messageCallbacks[message.topic]) {
|
|
74
|
-
|
|
74
|
+
try {
|
|
75
|
+
this._messageCallbacks[message.topic](message)
|
|
76
|
+
} catch (err) {
|
|
77
|
+
this._$onError(message.topic, null, err, message.data.slice(0))
|
|
78
|
+
}
|
|
75
79
|
} else {
|
|
76
80
|
message.processedError = true
|
|
77
81
|
this._$onError(
|
|
@@ -94,7 +98,9 @@ Client.prototype._$onError = function (topic, event, msgOrError, data) {
|
|
|
94
98
|
|
|
95
99
|
if (this.hasListeners('error')) {
|
|
96
100
|
this.emit('error', error)
|
|
97
|
-
|
|
101
|
+
if (event) {
|
|
102
|
+
this.emit(event, error)
|
|
103
|
+
}
|
|
98
104
|
} else {
|
|
99
105
|
console.log('--- You can catch all deepstream errors by subscribing to the error event ---')
|
|
100
106
|
|
package/src/record/record.js
CHANGED
|
@@ -101,7 +101,7 @@ class Record {
|
|
|
101
101
|
|
|
102
102
|
if (!this._version) {
|
|
103
103
|
this._patches = path && this._patches ? this._patches : []
|
|
104
|
-
this._patches.push(path, jsonPath.
|
|
104
|
+
this._patches.push(path, jsonPath.jsonClone(data))
|
|
105
105
|
this._handler._patch.add(this)
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -293,12 +293,7 @@ class Record {
|
|
|
293
293
|
if (this._version.charAt(0) !== 'I') {
|
|
294
294
|
let patchData = this._data
|
|
295
295
|
for (let n = 0; n < this._patches.length; n += 2) {
|
|
296
|
-
patchData = jsonPath.set(
|
|
297
|
-
patchData,
|
|
298
|
-
this._patches[n + 0],
|
|
299
|
-
jsonPath.parse(this._patches[n + 1]),
|
|
300
|
-
true
|
|
301
|
-
)
|
|
296
|
+
patchData = jsonPath.set(patchData, this._patches[n + 0], this._patches[n + 1], true)
|
|
302
297
|
}
|
|
303
298
|
this._update(patchData)
|
|
304
299
|
}
|