feat(spike): add logging and handling for KickNT command in bridge and session

This commit is contained in:
DrSmoothl committed 2026-06-16 00:34:03 +08:00
1 parent 6003acac56
commit 300fa70148
3 files changed
+21 -1

No files matched your search

+15
View File
@@ -63,6 +63,21 @@ export class Bridge implements BridgeInterface {
},
});
this.pipeline.registerCmd(MSG_PUSH_CMD, parseMsgPush);
// ── SPIKE PROBE (亡语 Q2) — 验完即删 ─────────────────────────────
// KickNT(被踢 push) 一到就同步试发一条带 T0 的私聊, 验 native teardown 前
// 是否还有可写窗口. 目标: env SPIKE_DEATHRATTLE_TARGET(uin), 缺省发给自己.
this.pipeline.registerCmd('trpc.qq_new_tech.status_svc.StatusService.KickNT', () => {
const t0 = Date.now();
const target = Number(process.env.SPIKE_DEATHRATTLE_TARGET) || Number(this.identity.uin) || 0;
log.warn('[SPIKE] KickNT@bridge T0=%d uin=%s target=%d', t0, this.identity.uin, target);
if (target > 0) {
this.apis.message.sendPrivate(target, [{ type: 'text', text: `亡语测试 T0=${t0}` }])
.then(r => log.warn('[SPIKE] send OK T0=%d T1=%d Δ=%dms seq=%d msgId=%d', t0, Date.now(), Date.now() - t0, r.sequence, r.messageId))
.catch(e => log.warn('[SPIKE] send FAIL T0=%d T1=%d Δ=%dms err=%s', t0, Date.now(), Date.now() - t0, e instanceof Error ? e.message : String(e)));
}
return [];
});
// ── /SPIKE PROBE ────────────────────────────────────────────────
}
dispose(): void {