fix spamming from purgatory

This commit is contained in:
KingKDot
2026-05-19 17:29:50 -05:00
parent 0c6863b702
commit bd192f7076
@@ -453,6 +453,8 @@ export async function handleWebSocketMessage(
logger.info(`[purgatory] client ${resolvedId} is pending approval`);
ws.send(encodeMessage({ type: "enrollment_status", status: "pending" }));
deps.notifyDashboard();
const isNewPurgatoryEntry = !existing || existing.enrollmentStatus !== "pending";
if (isNewPurgatoryEntry) {
deps.notifyDashboardClientEvent("client_purgatory", {
id: resolvedId,
host: _s((payload as any).host),
@@ -469,6 +471,7 @@ export async function handleWebSocketMessage(
ip: ip || undefined,
country,
});
}
setTimeout(() => { try { ws.close(4001, "pending"); } catch {} }, 100);
return;
}