stability fixes

This commit is contained in:
KingKDot
2026-05-04 09:58:59 -05:00
parent 8a7217cda2
commit c71af228b4
7 changed files with 174 additions and 76 deletions
+2 -5
View File
@@ -207,11 +207,7 @@ export function handlePing(info: ClientInfo, payload: WireMessage, ws: any) {
export function sendPingRequest(info: ClientInfo, ws: any, reason: string) {
const now = Date.now();
if (
info.lastPingNonce !== undefined &&
info.lastPingSent &&
now-info.lastPingSent < MAX_PING_RTT_MS
) {
if (info.lastPingSent && now - info.lastPingSent < 1_000) {
return;
}
const nonce = now + Math.floor(Math.random() * 1000);
@@ -245,6 +241,7 @@ export function handlePong(info: ClientInfo, payload: WireMessage) {
const nowTs = Date.now();
info.lastSeen = nowTs;
info.lastPongAt = nowTs;
info.online = true;
info.lastPingNonce = undefined;