@live-change/dao 0.9.160 → 0.9.161

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.
@@ -13,6 +13,15 @@ class LoopbackConnection extends Connection {
13
13
  this.headers = {}
14
14
  }
15
15
 
16
+ connectionInfo() {
17
+ return {
18
+ type: 'loopback',
19
+ server: this.server.connectionInfo(),
20
+ settings: this.settings,
21
+ credentials: this.credentials,
22
+ }
23
+ }
24
+
16
25
  next(fn) {
17
26
  if(this.delay) {
18
27
  setTimeout(fn, this.delay)
@@ -151,6 +151,13 @@ class Connection extends EventEmitter {
151
151
  this.on('connect', () => this.settings.onConnect && this.settings.onConnect() )
152
152
  }
153
153
 
154
+ connectionInfo() {
155
+ return {
156
+ settings: this.settings,
157
+ credentials: this.credentials,
158
+ }
159
+ }
160
+
154
161
  sendRequest(msg, userSettings) {
155
162
  const settings = { ...this.settings, ...userSettings }
156
163
  return new Promise((resolve, reject) => {
@@ -181,13 +188,13 @@ class Connection extends EventEmitter {
181
188
  setTimeout(() => {
182
189
  if(queuedConnectionId === this.connectedCounter) {
183
190
  this.requestsQueue[queueId] = null
184
- console.error("DISCONNECTED WHILE WAITING FOR REQUEST", msg)
191
+ console.error("DISCONNECTED WHILE WAITING FOR REQUEST", msg, 'CONNECTION', this.connectionInfo())
185
192
  reject('disconnected')
186
193
  }
187
194
  }, settings.requestSendTimeout || 2300)
188
195
  }
189
196
  } else {
190
- console.error("DISCONNECTED WHILE WAITING FOR REQUEST", msg)
197
+ console.error("DISCONNECTED WHILE WAITING FOR REQUEST", msg, 'CONNECTION', this.connectionInfo())
191
198
  return reject('disconnected')
192
199
  }
193
200
  }
package/package.json CHANGED
@@ -35,6 +35,6 @@
35
35
  "scripts": {
36
36
  "test": "NODE_ENV=test tape tests/*"
37
37
  },
38
- "version": "0.9.160",
39
- "gitHead": "b06d1855159b9e28917b97b59acb1ba0f5b7a4c8"
38
+ "version": "0.9.161",
39
+ "gitHead": "1361610ea2c25bfecff4ec102cde2fd2aecbdb53"
40
40
  }