dsh-ris-ide 1.8.1 → 1.8.3
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/README.md +2 -2
- package/lib/client.js +569 -98
- package/lib/debug/vendor/README.md +14 -0
- package/lib/debug/vendor/jdwp/client.js +9 -4
- package/lib/debug/vendor/src/jdwp/client.ts +12 -5
- package/lib/index.js +963 -64
- package/lib/redirector.js +76 -4
- package/lib/risd/lifecycle.js +54 -10
- package/lib/risd/ping.js +136 -17
- package/lib/risd/server.js +424 -22
- package/lib/risd/ui.js +218 -129
- package/lib/risd-client.js +4 -1
- package/lib/startup.js +27 -7
- package/package.json +2 -2
- package/test/client-viewer.test.mjs +268 -93
- package/test/clipboard.test.mjs +259 -0
- package/test/debug-engine.test.mjs +3 -1
- package/test/dsh-origin.test.mjs +4 -11
- package/test/dsh-window-refresh.test.mjs +166 -1
- package/test/harness.test.mjs +1 -1
- package/test/helpers/cmd.mjs +29 -0
- package/test/helpers/tgz.mjs +71 -0
- package/test/host-search.test.mjs +18 -11
- package/test/host-tail.test.mjs +190 -25
- package/test/proxy-route.test.mjs +61 -0
- package/test/proxy-window.test.mjs +5 -0
- package/test/proxy.test.mjs +40 -11
- package/test/proxybridge-bundle.test.mjs +1 -59
- package/test/redirector-bundle.test.mjs +21 -67
- package/test/redirector.test.mjs +71 -4
- package/test/risd-api.test.mjs +83 -29
- package/test/risd-bridge-degrade.test.mjs +3 -29
- package/test/risd-cli-home.test.mjs +41 -4
- package/test/risd-engine.test.mjs +13 -50
- package/test/risd-entry.test.mjs +0 -37
- package/test/risd-follow-start.test.mjs +102 -0
- package/test/risd-git.test.mjs +7 -5
- package/test/risd-handoff.test.mjs +6 -50
- package/test/risd-helpers.mjs +150 -3
- package/test/risd-host-p2.test.mjs +2 -30
- package/test/risd-lifecycle.test.mjs +203 -33
- package/test/risd-ping.test.mjs +77 -1
- package/test/risd-programs.test.mjs +4 -34
- package/test/risd-review-p2.test.mjs +0 -13
- package/test/risd-shutdown.test.mjs +5 -38
- package/test/risd-teardown.test.mjs +8 -27
- package/test/risd-ui.test.mjs +205 -14
- package/test/risd-write.test.mjs +2 -1
- package/test/startup-reconcile.test.mjs +44 -8
- package/test/proxy-restart.test.mjs +0 -39
|
@@ -18,6 +18,20 @@
|
|
|
18
18
|
| 内存 | +5MB RSS(实测) | ~40–60MB |
|
|
19
19
|
| 集成 | 面板/agent/路由共用同一会话 | 工具在 `mcp__jvm-debug__*`,面板需另建通道 |
|
|
20
20
|
|
|
21
|
+
## 本地补丁(重 vendor 时必须保留)
|
|
22
|
+
|
|
23
|
+
**`sendCommand` 的看门狗定时器要清掉**(2026-11-11,`jdwp/client.js` 与 `src/jdwp/client.ts` 同步):
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
const timer = setTimeout(() => { /* 超时 reject */ }, this.timeout)
|
|
27
|
+
timer.unref?.()
|
|
28
|
+
this.pendingRequests.set(id, { resolve, reject, timer })
|
|
29
|
+
// processBuffer 收到对应 reply 时:
|
|
30
|
+
clearTimeout(pending.timer)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
上游原实现每条命令都留一个 **10 s** 定时器、且不 `unref`、回复到达也不 `clearTimeout`:最后一条命令之后事件循环被吊满 10 s(`test/debug-engine.test.mjs` 因此从 1.9 s 变成 12.5 s),真实调试会话收尾也会白等。清理点就是收 reply 的那一支(`const pending = this.pendingRequests.get(id)` 之后、`pending.resolve(...)` 之前)——`clearTimeout(undefined)` 本身是安全的,所以不额外判空;别把清理只写在 `delete` 之后却漏掉 early-return 的分支。
|
|
34
|
+
|
|
21
35
|
## 重新构建(上游有更新或改了 TS 源码时)
|
|
22
36
|
|
|
23
37
|
```bash
|
|
@@ -178,6 +178,7 @@ export class JDWPClient extends EventEmitter {
|
|
|
178
178
|
const pending = this.pendingRequests.get(id);
|
|
179
179
|
if (pending) {
|
|
180
180
|
this.pendingRequests.delete(id);
|
|
181
|
+
clearTimeout(pending.timer);
|
|
181
182
|
pending.resolve({ id, flags: FLAGS_REPLY, errorCode, data });
|
|
182
183
|
}
|
|
183
184
|
}
|
|
@@ -308,15 +309,19 @@ export class JDWPClient extends EventEmitter {
|
|
|
308
309
|
}
|
|
309
310
|
const id = this.nextId++;
|
|
310
311
|
const packet = buildCommandPacket(id, commandSet, command, data);
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
//
|
|
314
|
-
|
|
312
|
+
// The timeout is kept with the request so the reply can clear it: a timer
|
|
313
|
+
// left behind per command keeps the event loop alive for 10 s after the
|
|
314
|
+
// last command (a test run then hangs for seconds), and a long debug
|
|
315
|
+
// session would accumulate one timer per command.
|
|
316
|
+
const timer = setTimeout(() => {
|
|
315
317
|
if (this.pendingRequests.has(id)) {
|
|
316
318
|
this.pendingRequests.delete(id);
|
|
317
319
|
reject(new Error(`Command timeout: cmdSet=${commandSet}, cmd=${command}`));
|
|
318
320
|
}
|
|
319
321
|
}, 10000);
|
|
322
|
+
timer.unref?.();
|
|
323
|
+
this.pendingRequests.set(id, { resolve, reject, timer });
|
|
324
|
+
this.socket.write(packet);
|
|
320
325
|
});
|
|
321
326
|
}
|
|
322
327
|
checkError(reply) {
|
|
@@ -75,6 +75,8 @@ export interface VariableInfo {
|
|
|
75
75
|
interface PendingRequest {
|
|
76
76
|
resolve: (reply: ReplyPacket) => void;
|
|
77
77
|
reject: (err: Error) => void;
|
|
78
|
+
/** The per-command watchdog, cleared by the reply (see `sendCommand`). */
|
|
79
|
+
timer?: ReturnType<typeof setTimeout>;
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
/**
|
|
@@ -278,6 +280,7 @@ export class JDWPClient extends EventEmitter {
|
|
|
278
280
|
const pending = this.pendingRequests.get(id);
|
|
279
281
|
if (pending) {
|
|
280
282
|
this.pendingRequests.delete(id);
|
|
283
|
+
clearTimeout(pending.timer);
|
|
281
284
|
pending.resolve({ id, flags: FLAGS_REPLY, errorCode, data });
|
|
282
285
|
}
|
|
283
286
|
} else {
|
|
@@ -417,16 +420,20 @@ export class JDWPClient extends EventEmitter {
|
|
|
417
420
|
const id = this.nextId++;
|
|
418
421
|
const packet = buildCommandPacket(id, commandSet, command, data);
|
|
419
422
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
//
|
|
424
|
-
setTimeout(() => {
|
|
423
|
+
// The timeout is kept with the request so the reply can clear it: a timer
|
|
424
|
+
// left behind per command keeps the event loop alive for 10 s after the last
|
|
425
|
+
// command (a test run then hangs for seconds), and a long debug session would
|
|
426
|
+
// accumulate one timer per command.
|
|
427
|
+
const timer = setTimeout(() => {
|
|
425
428
|
if (this.pendingRequests.has(id)) {
|
|
426
429
|
this.pendingRequests.delete(id);
|
|
427
430
|
reject(new Error(`Command timeout: cmdSet=${commandSet}, cmd=${command}`));
|
|
428
431
|
}
|
|
429
432
|
}, 10000);
|
|
433
|
+
timer.unref?.();
|
|
434
|
+
|
|
435
|
+
this.pendingRequests.set(id, { resolve, reject, timer });
|
|
436
|
+
this.socket.write(packet);
|
|
430
437
|
});
|
|
431
438
|
}
|
|
432
439
|
|