dsh-fishpal 0.9.31 → 0.10.0
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/CHANGELOG.md +182 -0
- package/README.md +53 -10
- package/_selftest-memory-adapter.mjs +11 -1
- package/_selftest.mjs +11 -2
- package/_verify-bottle-route.mjs +5 -3
- package/_verify-peer-name.mjs +7 -5
- package/_verify-presence.mjs +7 -1
- package/lib/adapter.js +32 -4
- package/lib/config.js +73 -1
- package/lib/delivery-map.js +36 -6
- package/lib/heartbeat.js +9 -2
- package/lib/index.js +399 -53
- package/lib/localserver.js +4 -0
- package/lib/outbox.js +231 -0
- package/lib/peer.js +57 -30
- package/lib/pending-questions.js +130 -0
- package/lib/presence.js +13 -3
- package/lib/protocol.js +110 -9
- package/lib/router.js +162 -3
- package/lib/safe.js +301 -0
- package/lib/state.js +12 -0
- package/lib/transport.js +158 -27
- package/lib/ui.js +64 -0
- package/package.json +10 -3
- package/scripts/lint-dead.mjs +399 -0
- package/scripts/log-audit.mjs +138 -0
- package/scripts/mutate.mjs +151 -0
- package/tests/a3-routing.mjs +194 -0
- package/tests/a4-questions.mjs +130 -0
- package/tests/b5-b6-thread.mjs +155 -0
- package/tests/b7-b8-expiry.mjs +158 -0
- package/tests/c1-mailbox.mjs +124 -0
- package/tests/d1-state.mjs +89 -0
- package/tests/e1-outbox.mjs +195 -0
- package/tests/e2e-pool-live.mjs +3 -1
- package/tests/e2e-sim.mjs +303 -0
- package/tests/g1-config.mjs +107 -0
- package/tests/g2-input.mjs +105 -0
- package/tests/h1-nick.mjs +138 -0
- package/tests/run.mjs +38 -0
- package/tests/x1-charfilter.mjs +138 -0
- package/tests/x1-pii.mjs +134 -0
- package/tests/x3-property.mjs +155 -0
package/lib/heartbeat.js
CHANGED
|
@@ -284,10 +284,17 @@ export function startHeartbeat({
|
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
if (timer) return;
|
|
287
|
+
// ★ 2026-12-04:`void tick()` 有个洞 —— tick 的 232~239 行(optsNow / shouldPing)
|
|
288
|
+
// 在它自己的 try 之外,只要那几行抛一次,返回的 rejected promise 就没人接,
|
|
289
|
+
// DSH 的 installFailLoud 直接 exit(1),**整个进程被一个心跳带走**。
|
|
290
|
+
// 这里统一补一个 catch。tick 内部已有的 try/catch 照旧生效。
|
|
291
|
+
const guard = () => {
|
|
292
|
+
void tick().catch((e) => log?.warn?.(`主动心跳那次没跑成:${e?.message ?? e}`));
|
|
293
|
+
};
|
|
287
294
|
// 头一次先等 1 分钟,别在刚启动、鱼还在加载时就去敲它
|
|
288
295
|
const first = setTimeout(() => {
|
|
289
|
-
|
|
290
|
-
timer = setInterval(
|
|
296
|
+
guard();
|
|
297
|
+
timer = setInterval(guard, opts.intervalMin * 60_000);
|
|
291
298
|
if (timer.unref) timer.unref();
|
|
292
299
|
}, 60_000);
|
|
293
300
|
if (first.unref) first.unref();
|