@knowlearning/agents 0.9.105 → 0.9.107
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.
|
@@ -52,6 +52,7 @@ export default function messageQueue({ token, domain, Connection, watchers, stat
|
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
si += 1
|
|
55
|
+
if (responses[si]) console.log('ERROR! response for si already set!', si, scope, patch)
|
|
55
56
|
lastSynchronousScopePatchPromise = new Promise((resolve, reject) => responses[si] = [[resolve, reject]])
|
|
56
57
|
messageQueue.push({ scope, patch, si, ts: Date.now()})
|
|
57
58
|
lastSynchronousScopePatched = scope
|
|
@@ -72,6 +73,7 @@ export default function messageQueue({ token, domain, Connection, watchers, stat
|
|
|
72
73
|
try {
|
|
73
74
|
connection.send(messageQueue[lastSentSI + 1])
|
|
74
75
|
lastSentSI += 1
|
|
76
|
+
console.log('SENDING MESSAGE!!!!!!!!!!', lastSentSI, messageQueue[lastSentSI])
|
|
75
77
|
// async so we don't try and push more to a closed connection
|
|
76
78
|
await new Promise(r=>r())
|
|
77
79
|
}
|
|
@@ -166,6 +168,7 @@ export default function messageQueue({ token, domain, Connection, watchers, stat
|
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
else if (message.si !== undefined) {
|
|
171
|
+
console.log('GOT RESPONSE', message.si, message, responses)
|
|
169
172
|
if (responses[message.si]) {
|
|
170
173
|
// TODO: remove "acknowledged" messages from queue and do accounting with si
|
|
171
174
|
responses[message.si]
|