@trim21/personal-pi-extensions 0.0.347 → 0.0.348
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/package.json +1 -1
- package/src/talk/core.ts +15 -0
package/package.json
CHANGED
package/src/talk/core.ts
CHANGED
|
@@ -267,6 +267,21 @@ export class TalkCore {
|
|
|
267
267
|
// both timing out.
|
|
268
268
|
await this.resolveInterlock(letter);
|
|
269
269
|
await trackIncomingAsk(this.storage, self.addr, letter);
|
|
270
|
+
} else if (letter.kind === "message") {
|
|
271
|
+
// A plain message from a peer we are blocked asking breaks the wait: the
|
|
272
|
+
// peer is engaging, so do not keep the caller stuck waiting for a reply.
|
|
273
|
+
const myAsk = await this.findOutAskTo(letter.from.addr);
|
|
274
|
+
if (myAsk) {
|
|
275
|
+
const waiter = this.askWaiters.get(myAsk.askId);
|
|
276
|
+
if (waiter) {
|
|
277
|
+
this.askWaiters.delete(myAsk.askId);
|
|
278
|
+
waiter({
|
|
279
|
+
replied: false,
|
|
280
|
+
reason: "peer sent a message instead of replying to your ask",
|
|
281
|
+
});
|
|
282
|
+
await clearAsk(this.storage, self.addr, myAsk.askId);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
270
285
|
}
|
|
271
286
|
return true;
|
|
272
287
|
}
|