Skip to content

Commit 321a1ce

Browse files
committed
build: refresh deadline race snapshot
1 parent 86bf231 commit 321a1ce

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

marketplace/.agents/plugins/provenance.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"packageVersion": "0.1.0",
33
"pluginVersion": "0.1.0",
4-
"sourceRef": "40dc983b7f3e851201bf7d5fa87de2155249fdf6",
5-
"sourceSha": "40dc983b7f3e851201bf7d5fa87de2155249fdf6",
4+
"sourceRef": "86bf231d2a7bd17835000a8d22329e5cabe7b7cd",
5+
"sourceSha": "86bf231d2a7bd17835000a8d22329e5cabe7b7cd",
66
"dependencyLock": {
77
"file": "npm-shrinkwrap.json",
88
"sha256": "fa927194e6ca0b25c1d3f428859b2ab4798b8eabb4d31bc87188d73c630f9938"

marketplace/plugins/zcode/scripts/lib/zcode-protocol.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ export class ZCodeProtocolClient {
5959
const effectiveTimeoutMs = timeoutMs ?? this.requestTimeoutMs;
6060
return new Promise((resolve, reject) => {
6161
const timer = setTimeout(() => {
62-
this.pending.delete(id);
63-
reject(new PluginError('ZCODE_REQUEST_TIMEOUT', `ZCode request timed out: ${method}.`, { category: 'timeout', remedy: 'Retry the operation.', details: { method, timeoutMs: effectiveTimeoutMs } }));
62+
setImmediate(() => {
63+
if (this.pending.get(id) !== pending) return;
64+
this.pending.delete(id);
65+
reject(new PluginError('ZCODE_REQUEST_TIMEOUT', `ZCode request timed out: ${method}.`, { category: 'timeout', remedy: 'Retry the operation.', details: { method, timeoutMs: effectiveTimeoutMs } }));
66+
});
6467
}, effectiveTimeoutMs);
6568
timer.unref?.();
66-
this.pending.set(id, { resolve, reject, timer, method });
69+
const pending = { resolve, reject, timer, method };
70+
this.pending.set(id, pending);
6771
try { this.sendFrame({ id, method, params }); } catch (error) { clearTimeout(timer); this.pending.delete(id); reject(error); }
6872
});
6973
}

0 commit comments

Comments
 (0)