From 0adc270cf8ca6bd8106a0fb834c197a76c76f5aa Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Wed, 15 Apr 2026 08:03:02 -0600 Subject: [PATCH 1/2] Reset the event timer when resuming from a paused breakpoint --- server/throttle.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/throttle.ts b/server/throttle.ts index 6d1eda3f1..2d66325f9 100644 --- a/server/throttle.ts +++ b/server/throttle.ts @@ -1,4 +1,5 @@ import { logger } from '../utility/logging/logger.ts'; +import { Session, url as inspectorURL } from 'inspector'; const MAX_EVENT_DELAY_TIME = 3000; const DEFAULT_MAX_QUEUE_TIME = 20_000; // 20 seconds let lastWarning = 0; @@ -71,3 +72,20 @@ setInterval(() => { } lastEventQueueCheck = now; }, EVENT_QUEUE_MONITORING_INTERVAL).unref(); + +// Reset lastEventQueueCheck if we are resuming from the debugger +// so the event loop lag check ignores breakpoint pauses +setTimeout(() => { + // wait for any debugger to register and then see if the inspector/debugger is actually enabled + if (inspectorURL()) { + const session = new Session(); + session.connect(); + session.post('Debugger.enable'); + session.on('inspectorNotification', ({ method }) => { + if (method === 'Debugger.resumed') { + // reset if we are resuming + lastEventQueueCheck = performance.now(); + } + }); + } +}, 1); From a3fec71efa1f01eeb7d282a76694a3709fa58b09 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Wed, 15 Apr 2026 14:34:18 -0600 Subject: [PATCH 2/2] Update server/throttle.ts Co-authored-by: Chris Barber --- server/throttle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/throttle.ts b/server/throttle.ts index 2d66325f9..beca819c1 100644 --- a/server/throttle.ts +++ b/server/throttle.ts @@ -1,5 +1,5 @@ import { logger } from '../utility/logging/logger.ts'; -import { Session, url as inspectorURL } from 'inspector'; +import { Session, url as inspectorURL } from 'node:inspector'; const MAX_EVENT_DELAY_TIME = 3000; const DEFAULT_MAX_QUEUE_TIME = 20_000; // 20 seconds let lastWarning = 0;