From 73d08d3cfb95dd10f5a911bb4520e87546f905ba Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Thu, 24 Sep 2026 13:43:12 +0000 Subject: [PATCH] test: follow the #6717 render-scheduler signature; guard the burst reset for node harnesses _scheduleMessageVirtualizedRender now takes (force, request), so the two structural probes in test_issue4346_vscroll_footer_jitter.py matched nothing. renderMessages() calls _resetMessageVirtualMeasurementBurst(), which node harnesses that extract renderMessages() alone (test_compaction_current_summary_fallback.py) don't define; guard it with typeof like the file's other optional helpers. --- static/ui.js | 3 ++- tests/test_issue4346_vscroll_footer_jitter.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/static/ui.js b/static/ui.js index adff96c9..fd444e65 100644 --- a/static/ui.js +++ b/static/ui.js @@ -16640,7 +16640,8 @@ function _processWakeupCardHtml(info, rawText, extras){ function renderMessages(options){ _lastMessageRenderAt=performance.now(); - if(!(options&&options._internalMeasurement)){ _resetMessageVirtualMeasurementBurst(); } + // typeof guard: node harnesses extract renderMessages() without its helpers (#6717). + if(!(options&&options._internalMeasurement) && typeof _resetMessageVirtualMeasurementBurst==='function'){ _resetMessageVirtualMeasurementBurst(); } const preserveScroll=!!(options&&options.preserveScroll); const virtualFallback=!!(options&&options._virtualFallback); // Capture the pre-wipe scroll position when preserving OR when the reader has diff --git a/tests/test_issue4346_vscroll_footer_jitter.py b/tests/test_issue4346_vscroll_footer_jitter.py index 12d14185..5448a907 100644 --- a/tests/test_issue4346_vscroll_footer_jitter.py +++ b/tests/test_issue4346_vscroll_footer_jitter.py @@ -99,7 +99,7 @@ def test_js_recycle_flag_lifecycle(): """_scheduleMessageVirtualizedRender sets _msgNodeRecycleEnabled=true before the compensate call and clears it in finally.""" fn_match = re.search( - r'function _scheduleMessageVirtualizedRender\(force\)\{(.+?)^(?=function )', + r'function _scheduleMessageVirtualizedRender\(force(?:, request)?\)\{(.+?)^(?=function )', JS, re.DOTALL | re.MULTILINE ) assert fn_match, "_scheduleMessageVirtualizedRender not found" @@ -1101,7 +1101,7 @@ class TestScrollbarDragRenderDuringDrag: """_scheduleMessageVirtualizedRender must have a _scrollbarDragActive branch that runs a full render with scroll compensation.""" fn_match = re.search( - r'function _scheduleMessageVirtualizedRender\(force\)\{(.+?)^(?=function )', + r'function _scheduleMessageVirtualizedRender\(force(?:, request)?\)\{(.+?)^(?=function )', JS, re.DOTALL | re.MULTILINE ) assert fn_match, "_scheduleMessageVirtualizedRender not found"