@nxtedition/deepstream.io-client-js 23.4.50 → 23.4.52
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
|
@@ -325,12 +325,14 @@ class RecordHandler {
|
|
|
325
325
|
const record = this.getRecord(name).subscribe(onUpdate)
|
|
326
326
|
|
|
327
327
|
if (timeoutValue && state && record.state < state) {
|
|
328
|
-
timeoutHandle = timers.
|
|
328
|
+
timeoutHandle = timers.setTimeout(() => {
|
|
329
329
|
const expected = C.RECORD_STATE_NAME[state]
|
|
330
330
|
const current = C.RECORD_STATE_NAME[record.state]
|
|
331
331
|
o.error(
|
|
332
332
|
Object.assign(
|
|
333
|
-
new Error(
|
|
333
|
+
new Error(
|
|
334
|
+
`timeout after ${timeoutValue / 1e3}s: ${record.name} [${current}<${expected}]`
|
|
335
|
+
),
|
|
334
336
|
{ code: 'ETIMEDOUT' }
|
|
335
337
|
)
|
|
336
338
|
)
|
package/src/record/record.js
CHANGED
|
@@ -59,8 +59,8 @@ class Record {
|
|
|
59
59
|
|
|
60
60
|
unref() {
|
|
61
61
|
invariant(this._refs > 0, 'missing refs')
|
|
62
|
-
invariant(this._refs >
|
|
63
|
-
invariant(this._refs >
|
|
62
|
+
invariant(this._refs > 0 || !this._patches, 'must not have patches')
|
|
63
|
+
invariant(this._refs > 0 || this._state >= Record.STATE.SERVER, 'must be ready')
|
|
64
64
|
|
|
65
65
|
this._refs -= 1
|
|
66
66
|
if (this._refs === 0) {
|