@knowlearning/agents 0.4.4 → 0.4.5
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.js +3 -2
- package/package.json +1 -1
package/agents/generic.js
CHANGED
|
@@ -162,7 +162,8 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
|
|
|
162
162
|
const key = `${message.domain}/${message.user}/${message.scope}`
|
|
163
163
|
const sub = subscription(key)
|
|
164
164
|
if (watchers[key]) {
|
|
165
|
-
|
|
165
|
+
// TODO: debug case where sub is not defined
|
|
166
|
+
if (sub && sub.ii + 1 !== message.ii) {
|
|
166
167
|
// TODO: this seems to be an error that happens with decent regularity (an answer with a given si was skipped/failed)
|
|
167
168
|
// we should be wary of out-of-order ii being passed down (maybe need to wait for older ones???)
|
|
168
169
|
console.warn('UNEXPECTED UPDATE INTERACTION INDEX!!!!!!!!!!! last index in session', sub, ' passed index ', message.ii)
|
|
@@ -174,7 +175,7 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
|
|
|
174
175
|
|
|
175
176
|
applyPatch(states[key], standardJSONPatch(message.patch.slice(lastResetPatchIndex + 1)))
|
|
176
177
|
watchers[key].forEach(fn => fn({ ...message, state: states[key] }))
|
|
177
|
-
sub.ii = message.ii
|
|
178
|
+
if (sub) sub.ii = message.ii
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
}
|