From 43afc498b8c0cc6259280fbd26355ab9565b6c91 Mon Sep 17 00:00:00 2001 From: t Date: Wed, 8 Jul 2026 20:18:10 +0000 Subject: [PATCH] test+style: fix 2 full-suite regressions from the channel edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_api_timeout: assert the updates/check call keeps timeoutMs:60000 in its new _checkBody form (functionally identical; still the 60s override) - panels.js: reword two // comments to drop apostrophes — the smooth-text-fade brace-matcher test treats ' in a comment as a string delimiter and lost loadSettingsPanel's closing brace (node --check confirms the JS was always valid) --- static/panels.js | 4 ++-- tests/test_api_timeout.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/static/panels.js b/static/panels.js index 1e6a05ed..366e196a 100644 --- a/static/panels.js +++ b/static/panels.js @@ -9152,7 +9152,7 @@ async function loadSettingsPanel(){ // update banner still gates the actual apply behind "Update Now". _schedulePreferencesAutosave(); if(typeof checkUpdatesNow==='function'){ - // Pass the just-selected channel EXPLICITLY so the re-check can't race + // Pass the just-selected channel EXPLICITLY so the re-check cannot race // the debounced autosave PUT and answer for the previous channel. const _picked=updateChannelSel.value; setTimeout(function(){try{checkUpdatesNow(_picked);}catch(e){}},400); @@ -11763,7 +11763,7 @@ async function checkUpdatesNow(channelOverride){ try { // Pass the channel explicitly when the caller has one (e.g. the dropdown - // just switched) so the check can't race the debounced settings autosave + // just switched) so the check cannot race the debounced settings autosave // and answer for the previous channel. Omit otherwise → server uses the // saved setting. (Fable UX gate.) const _checkBody={force:true}; diff --git a/tests/test_api_timeout.py b/tests/test_api_timeout.py index 74d184f3..ed758e97 100644 --- a/tests/test_api_timeout.py +++ b/tests/test_api_timeout.py @@ -211,7 +211,9 @@ def test_update_flows_keep_explicit_longer_timeouts(): """Legitimately long update flows should not inherit the generic 30s guard.""" src = _source(UI_JS) panels = _source(PANELS_JS) - assert "api('/api/updates/check',{method:'POST',body:JSON.stringify({force:true}),timeoutMs:60000})" in panels + # /api/updates/check builds its body in a _checkBody var (to optionally add + # an explicit channel), but must still carry the 60s timeout override. + assert "api('/api/updates/check',{method:'POST',body:JSON.stringify(_checkBody),timeoutMs:60000})" in panels assert "api('/api/updates/summary',{method:'POST',body:JSON.stringify({updates:scopedUpdates,target:target||null}),timeoutMs:60000})" in src assert "api('/api/updates/apply',{method:'POST',body:JSON.stringify({target}),timeoutMs:120000})" in src assert "api('/api/updates/force',{method:'POST',body:JSON.stringify({target}),timeoutMs:120000})" in src