@nxtedition/deepstream.io-client-js 31.2.16 → 31.2.17

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": "31.2.16",
3
+ "version": "31.2.17",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  import * as C from '../constants/constants.js'
2
2
  import * as messageBuilder from '../message/message-builder.js'
3
3
  import * as messageParser from '../message/message-parser.js'
4
- import MulticastListener from '../utils/multicast-listener.js'
4
+ import LegacyListener from '../utils/legacy-listener.js'
5
5
  import UnicastListener from '../utils/unicast-listener.js'
6
6
  import EventEmitter from 'component-emitter2'
7
7
  import * as rxjs from 'rxjs'
@@ -126,7 +126,7 @@ EventHandler.prototype.provide = function (pattern, callback, options) {
126
126
  const listener =
127
127
  options.mode?.toLowerCase() === 'unicast'
128
128
  ? new UnicastListener(C.TOPIC.EVENT, pattern, callback, this, options)
129
- : new MulticastListener(C.TOPIC.EVENT, pattern, callback, this, options)
129
+ : new LegacyListener(C.TOPIC.EVENT, pattern, callback, this, options)
130
130
 
131
131
  this._listeners.set(pattern, listener)
132
132
  return () => {
@@ -1,5 +1,5 @@
1
1
  import Record from './record.js'
2
- import MulticastListener from '../utils/multicast-listener.js'
2
+ import LegacyListener from '../utils/legacy-listener.js'
3
3
  import UnicastListener from '../utils/unicast-listener.js'
4
4
  import * as C from '../constants/constants.js'
5
5
  import * as rxjs from 'rxjs'
@@ -84,9 +84,18 @@ function onTimeout(subscription) {
84
84
 
85
85
  subscription.subscriber.error(
86
86
  Object.assign(
87
- new Error(`timeout state: ${subscription.record.name} [${current}<${expected}]`),
87
+ new Error(
88
+ !subscription.synced
89
+ ? `timeout sync: ${subscription.record.name}`
90
+ : `timeout state: ${subscription.record.name} [${current}<${expected}]`,
91
+ ),
88
92
  {
89
93
  code: 'ETIMEDOUT',
94
+ timeout: subscription.timeoutValue,
95
+ expected,
96
+ current,
97
+ synced: subscription.synced,
98
+ name: subscription.record.name,
90
99
  },
91
100
  ),
92
101
  )
@@ -261,7 +270,7 @@ class RecordHandler {
261
270
  const listener =
262
271
  options.mode?.toLowerCase() === 'unicast'
263
272
  ? new UnicastListener(C.TOPIC.RECORD, pattern, callback, this, options)
264
- : new MulticastListener(C.TOPIC.RECORD, pattern, callback, this, options)
273
+ : new LegacyListener(C.TOPIC.RECORD, pattern, callback, this, options)
265
274
 
266
275
  this._stats.listeners += 1
267
276
  this._listeners.set(pattern, listener)
@@ -678,7 +687,6 @@ class RecordHandler {
678
687
  subscription.record = this.getRecord(name).subscribe(onUpdate, subscription)
679
688
 
680
689
  if (sync) {
681
- // TODO (fix): What about sync timeout?
682
690
  this._sync(onSync, sync === true ? 'WEAK' : sync, subscription)
683
691
  } else {
684
692
  onSync(subscription)
@@ -1,6 +1,6 @@
1
1
  import * as rxjs from 'rxjs'
2
2
  import * as C from '../constants/constants.js'
3
- import { h64ToString, findBigIntPaths } from '../utils/utils.js'
3
+ import { h64ToString, findBigIntPaths } from './utils.js'
4
4
 
5
5
  export default class Listener {
6
6
  constructor(topic, pattern, callback, handler, { recursive = false, stringify = null } = {}) {