mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 10:23:07 +00:00
Changes from fix/dev-server-hang
This commit is contained in:
@@ -923,17 +923,19 @@ export class HttpApiClient implements ElectronAPI {
|
||||
this.ws.onmessage = (event) => {
|
||||
try {
|
||||
const data = JSON.parse(event.data);
|
||||
logger.info(
|
||||
'WebSocket message:',
|
||||
data.type,
|
||||
'hasPayload:',
|
||||
!!data.payload,
|
||||
'callbacksRegistered:',
|
||||
this.eventCallbacks.has(data.type)
|
||||
);
|
||||
// Only log non-high-frequency events to avoid progressive memory growth
|
||||
// from accumulated console entries. High-frequency events (dev-server output,
|
||||
// test runner output, agent progress) fire 10+ times/sec and would generate
|
||||
// thousands of console entries per minute.
|
||||
const isHighFrequency =
|
||||
data.type === 'dev-server:output' ||
|
||||
data.type === 'test-runner:output' ||
|
||||
data.type === 'auto_mode_progress';
|
||||
if (!isHighFrequency) {
|
||||
logger.info('WebSocket message:', data.type);
|
||||
}
|
||||
const callbacks = this.eventCallbacks.get(data.type);
|
||||
if (callbacks) {
|
||||
logger.info('Dispatching to', callbacks.size, 'callbacks');
|
||||
callbacks.forEach((cb) => cb(data.payload));
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user