@youdu/openclaw-youdu 2026.6.26 → 2026.7.3
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.
|
@@ -97,9 +97,7 @@ class WsConnectionManager extends EventEmitter {
|
|
|
97
97
|
let frame;
|
|
98
98
|
try {
|
|
99
99
|
frame = JSON.parse(raw);
|
|
100
|
-
|
|
101
|
-
this.logger.info(`[WS] <<< Received message (${raw.length} chars): ${raw}`);
|
|
102
|
-
}
|
|
100
|
+
this.logger.info(`[WS] <<< Received message (${raw.length} chars): ${raw}`);
|
|
103
101
|
}
|
|
104
102
|
catch {
|
|
105
103
|
frame = {
|
|
@@ -137,6 +135,9 @@ class WsConnectionManager extends EventEmitter {
|
|
|
137
135
|
this.ws.on("ping", () => {
|
|
138
136
|
this.ws?.pong();
|
|
139
137
|
});
|
|
138
|
+
this.ws.on("pong", () => {
|
|
139
|
+
this.missedPongCount = 0;
|
|
140
|
+
});
|
|
140
141
|
this.logger.info("[WS] Event handlers registered");
|
|
141
142
|
}
|
|
142
143
|
sendAuth(forceSubscribe = false) {
|
|
@@ -255,17 +256,16 @@ class WsConnectionManager extends EventEmitter {
|
|
|
255
256
|
}
|
|
256
257
|
sendHeartbeat() {
|
|
257
258
|
if (this.missedPongCount >= this.maxMissedPong) {
|
|
258
|
-
this.logger.warn(`No heartbeat
|
|
259
|
+
this.logger.warn(`No heartbeat pong received for ${this.missedPongCount} consecutive pings`);
|
|
259
260
|
this.stopHeartbeat();
|
|
260
261
|
this.ws?.terminate();
|
|
261
262
|
return;
|
|
262
263
|
}
|
|
263
264
|
this.missedPongCount++;
|
|
264
265
|
try {
|
|
265
|
-
this.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
});
|
|
266
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
267
|
+
this.ws.ping();
|
|
268
|
+
}
|
|
269
269
|
}
|
|
270
270
|
catch (error) {
|
|
271
271
|
this.logger.error("Failed to send heartbeat:", error.message);
|