fix: add actionable DingTalk connection diagnostics

This commit is contained in:
xmanrui 2026-09-04 02:18:18 +08:00
parent 3010535409
commit 1b05fa8d32
18 changed files with 1038 additions and 299 deletions

View file

@ -376,10 +376,16 @@ test('runtime never reports ready when connect resolves before the socket opens
logger: { warn() {}, error() {} },
});
await assert.rejects(runtime.start(), /handshake timed out/);
await assert.rejects(
runtime.start(),
(error) => error.code === 'dingtalk-stream-connect-failed'
&& /handshake timed out/.test(error.message)
&& error.cause?.message === error.message,
);
assert.equal(disconnects, 1);
assert.equal(runtime.status.ready, false);
assert.equal(runtime.status.dingtalkStreamState, 'failed');
assert.match(runtime.status.lastError, /handshake timed out/);
});
test('runtime bounds a stalled SDK gateway lookup and disconnects a late connection', async () => {