@live-change/dao 0.5.20 → 0.5.22
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/lib/LoopbackConnection.js +1 -1
- package/lib/ReactiveServer.js +4 -0
- package/package.json +2 -2
- package/tests/clicks-list.js +1 -0
- package/tests/connection-monitors.js +1 -0
- package/tests/failed-dao-factory.js +1 -0
- package/tests/get-more.js +1 -0
- package/tests/insta-error.js +1 -0
- package/tests/loopback-connection.js +1 -0
- package/tests/malformed-packets.js +1 -0
- package/tests/observe-more.js +1 -0
- package/tests/promised-error.js +1 -0
- package/tests/promised-time-value.js +1 -0
- package/tests/request-resend.js +1 -0
- package/tests/time-sync.js +1 -0
- package/tests/time-value.js +1 -0
|
@@ -10,7 +10,6 @@ class LoopbackConnection extends Connection {
|
|
|
10
10
|
this.serverMessageListener = null
|
|
11
11
|
this.serverCloseListener = null
|
|
12
12
|
this.headers = {}
|
|
13
|
-
this.initialize()
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
next(fn) {
|
|
@@ -32,6 +31,7 @@ class LoopbackConnection extends Connection {
|
|
|
32
31
|
resolve(true)
|
|
33
32
|
})
|
|
34
33
|
})
|
|
34
|
+
return this.initPromise
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
send(message) {
|
package/lib/ReactiveServer.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const ReactiveServerConnection = require('./ReactiveServerConnection.js')
|
|
2
2
|
|
|
3
|
+
const debug = require('debug')('dao')
|
|
4
|
+
|
|
3
5
|
class ReactiveServer {
|
|
4
6
|
constructor(daoFactory, settings) {
|
|
5
7
|
this.settings = settings || {}
|
|
@@ -11,9 +13,11 @@ class ReactiveServer {
|
|
|
11
13
|
let id = ++this.lastConnectionId
|
|
12
14
|
let reactiveConnection = new ReactiveServerConnection(this, id, connection, this.daoFactory, this.settings)
|
|
13
15
|
this.connections.set( reactiveConnection.id, reactiveConnection )
|
|
16
|
+
debug("ReactiveServer: new connection", id, 'total', this.connections.size)
|
|
14
17
|
}
|
|
15
18
|
handleConnectionClose(reactiveConnection) {
|
|
16
19
|
this.connections.delete( reactiveConnection.id )
|
|
20
|
+
debug("ReactiveServer: connection closed", reactiveConnection.id, 'total', this.connections.size)
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
|
package/package.json
CHANGED
package/tests/clicks-list.js
CHANGED
package/tests/get-more.js
CHANGED
package/tests/insta-error.js
CHANGED
package/tests/observe-more.js
CHANGED
package/tests/promised-error.js
CHANGED
package/tests/request-resend.js
CHANGED
|
@@ -23,6 +23,7 @@ test("request resend", (t) => {
|
|
|
23
23
|
queueRequestsWhenDisconnected: true,
|
|
24
24
|
queueActiveRequestsOnDisconnect: true
|
|
25
25
|
})
|
|
26
|
+
client.initialize()
|
|
26
27
|
|
|
27
28
|
counter = client.observable(['test', 'counter'], testServerDao.ObservableCounter)
|
|
28
29
|
client.request(['test', 'reset'])
|
package/tests/time-sync.js
CHANGED