@nxtedition/deepstream.io-client-js 24.2.1 → 24.2.2
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/record/record-handler.js +18 -11
package/package.json
CHANGED
|
@@ -45,9 +45,12 @@ function onTimeout(subscription) {
|
|
|
45
45
|
const current = C.RECORD_STATE_NAME[subscription.record.state]
|
|
46
46
|
|
|
47
47
|
subscription.subscriber.error(
|
|
48
|
-
Object.assign(
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
Object.assign(
|
|
49
|
+
new Error(`timeout state: ${subscription.record.name} [${current}<${expected}]`),
|
|
50
|
+
{
|
|
51
|
+
code: 'ETIMEDOUT',
|
|
52
|
+
}
|
|
53
|
+
)
|
|
51
54
|
)
|
|
52
55
|
}
|
|
53
56
|
|
|
@@ -68,16 +71,20 @@ function onSyncFast(opaque) {
|
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
function onTimeoutFast(opaque) {
|
|
71
|
-
const { rec, resolve } = opaque
|
|
74
|
+
const { rec, synced, resolve } = opaque
|
|
72
75
|
rec.unsubscribe(onUpdateFast, opaque)
|
|
73
76
|
rec.unref()
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
)
|
|
80
|
-
|
|
77
|
+
|
|
78
|
+
let err
|
|
79
|
+
if (rec.state < opaque.state) {
|
|
80
|
+
err = new Error(`timeout state: ${opaque.rec.name} [${opaque.rec.state}<${opaque.state}]`)
|
|
81
|
+
} else if (!synced) {
|
|
82
|
+
err = new Error(`timeout sync: ${opaque.rec.name} `)
|
|
83
|
+
} else {
|
|
84
|
+
err = new Error('timeout')
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
resolve(Promise.reject(Object.assign(err, { code: 'ETIMEDOUT' })))
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
class RecordHandler {
|