@nxtedition/deepstream.io-client-js 23.4.59 → 23.4.61

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.59",
3
+ "version": "23.4.61",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -60,12 +60,13 @@ class RecordHandler {
60
60
 
61
61
  for (const rec of pruning) {
62
62
  rec._$dispose()
63
-
64
- this._stats.records -= 1
65
- this._stats.destroyed += 1
66
63
  this._records.delete(rec.name)
67
64
  }
68
65
 
66
+ this._stats.pruning -= pruning.size
67
+ this._stats.records -= pruning.size
68
+ this._stats.destroyed += pruning.size
69
+
69
70
  if (this._pruningTimeout) {
70
71
  this._pruningTimeout.refresh()
71
72
  } else {
@@ -53,20 +53,14 @@ class Record {
53
53
  this._handler._onPruning(this, false)
54
54
  this._subscribed = this._subscribed || this._sendMsg1(C.ACTIONS.SUBSCRIBE, this._name)
55
55
  }
56
-
57
56
  return this
58
57
  }
59
58
 
60
59
  unref() {
61
- invariant(this._refs > 0, 'missing refs')
62
- invariant(this._refs > 0 || !this._patching, 'must not have patches')
63
- invariant(this._refs > 0 || this._state >= C.RECORD_STATE.SERVER, 'must be ready')
64
-
65
60
  this._refs -= 1
66
61
  if (this._refs === 0) {
67
62
  this._handler._onPruning(this, true)
68
63
  }
69
-
70
64
  return this
71
65
  }
72
66
 
@@ -344,10 +338,10 @@ class Record {
344
338
 
345
339
  if (value) {
346
340
  this._patching = []
347
- this._refs += 1
341
+ this.ref()
348
342
  } else {
349
343
  this._patching = null
350
- this._refs -= 1
344
+ this.unref()
351
345
  }
352
346
 
353
347
  this._handler._onPatching(this, value)
@@ -358,10 +352,10 @@ class Record {
358
352
 
359
353
  if (value) {
360
354
  this._updating = new Map()
361
- this._refs += 1
355
+ this.ref()
362
356
  } else {
363
357
  this._updating = null
364
- this._refs -= 1
358
+ this.unref()
365
359
  }
366
360
 
367
361
  this._handler._onUpdating(this, value)
@@ -370,10 +364,10 @@ class Record {
370
364
  _onPending(value) {
371
365
  if (value) {
372
366
  this._pending = true
373
- this._refs += 1
367
+ this.ref()
374
368
  } else {
375
369
  this._pending = false
376
- this._refs -= 1
370
+ this.unref()
377
371
  }
378
372
 
379
373
  this._handler._onPending(this, value)