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"