change around pings, fix main.js so the actual real fucking number shows instead of it freaking out.

This commit is contained in:
KingKDot
2026-07-09 13:55:36 -05:00
parent f96b3d0721
commit 43ee5a7d4b
12 changed files with 293 additions and 32 deletions
+2 -4
View File
@@ -5,6 +5,7 @@ import { encodeMessage } from "./protocol";
import { v4 as uuidv4 } from "uuid";
import { metrics } from "./metrics";
import { logAudit, AuditAction } from "./auditLog";
import { sendPingRequest } from "./wsHandlers";
const DEFAULT_PAGE_SIZE = 12;
const CORS_HEADERS = {
@@ -61,10 +62,7 @@ export function handleCommand(target: ClientInfo, action: string, req: Request)
metrics.recordCommand(action);
if (action === "ping") {
const nonce = Date.now() + Math.floor(Math.random() * 1000);
target.lastPingSent = Date.now();
target.lastPingNonce = nonce;
target.ws.send(encodeMessage({ type: "ping", ts: nonce }));
sendPingRequest(target, target.ws, "manual", 0);
return OK();
}