@knowlearning/agents 0.9.121 → 0.9.124
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/agents/generic/message-queue.js +1 -0
- package/deno.js +2 -1
- package/package.json +1 -1
|
@@ -142,6 +142,7 @@ export default function messageQueue({ token, domain, Connection, watchers, stat
|
|
|
142
142
|
|
|
143
143
|
authed = true
|
|
144
144
|
if (!user) { // this is the first authed websocket connection
|
|
145
|
+
console.log('INIT MESSAGE', message)
|
|
145
146
|
sessionMetrics.authenticated = Date.now()
|
|
146
147
|
user = message.auth.user
|
|
147
148
|
session = message.session
|
package/deno.js
CHANGED
|
@@ -11,7 +11,8 @@ function Connection() {
|
|
|
11
11
|
this.send = message => denoProcess.postMessage({ ...message, connection })
|
|
12
12
|
|
|
13
13
|
denoProcess.addEventListener('message', ({ data }) => {
|
|
14
|
-
if (data
|
|
14
|
+
if (!data) this.onmessage(data) // think of better way that doesn't pass all heartbeats to all agents inside domain agent
|
|
15
|
+
else if (data.connection === connection) this.onmessage(data)
|
|
15
16
|
})
|
|
16
17
|
|
|
17
18
|
// TODO: consider what onclose and onerror mean
|