From faed296819c68d341935110c97d2b9ea90df7de3 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Mon, 29 Jun 2026 10:03:36 -0400 Subject: [PATCH] fix(#4961): keep URL boot prefill draft-only --- static/boot.js | 6 ------ static/sessions.js | 3 +-- tests/test_4961_url_query_prefill.py | 8 ++++---- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/static/boot.js b/static/boot.js index adc34a67..5931b464 100644 --- a/static/boot.js +++ b/static/boot.js @@ -111,12 +111,6 @@ async function _applyComposerPrefillOnBoot(prefillIntent){ msg.value=text; if(typeof autoResize==='function') autoResize(); else if(typeof updateSendBtn==='function') updateSendBtn(); - if(!prefillIntent.autoSend) return; - if(typeof handleComposerPrimaryAction==='function'){ - await handleComposerPrimaryAction(); - return; - } - if(typeof send==='function') await send(); } // Mobile navigation. diff --git a/static/sessions.js b/static/sessions.js index 0e47c45a..5108f500 100644 --- a/static/sessions.js +++ b/static/sessions.js @@ -3230,12 +3230,11 @@ function _composerPrefillIntentFromLocation(){ const hasSend=qs.has('send'); if(!hasQ&&!hasPrompt&&!hasSend) return empty; const text=hasQ?(qs.get('q')||''):(hasPrompt?(qs.get('prompt')||''):''); - const autoSend=hasSend&&/^(1|true|yes|on)$/i.test(String(qs.get('send')||'').trim()); return { hasParams:true, hasText:!!String(text).trim(), text, - autoSend + autoSend:false }; }catch(_e){return empty;} } diff --git a/tests/test_4961_url_query_prefill.py b/tests/test_4961_url_query_prefill.py index 08e06b81..f69280e0 100644 --- a/tests/test_4961_url_query_prefill.py +++ b/tests/test_4961_url_query_prefill.py @@ -73,7 +73,7 @@ console.log(JSON.stringify({ first, second, third })); "hasParams": True, "hasText": True, "text": "hello world", - "autoSend": True, + "autoSend": False, } assert payload["second"] == { "hasParams": True, @@ -85,7 +85,7 @@ console.log(JSON.stringify({ first, second, third })); "hasParams": True, "hasText": False, "text": " ", - "autoSend": True, + "autoSend": False, } @@ -155,7 +155,7 @@ console.log(JSON.stringify(result)); assert load_pos > prefill_guard -def test_apply_prefill_updates_composer_and_optionally_autosends(): +def test_apply_prefill_updates_composer_without_autosending(): source = _node_prelude() + """ (async () => { evalBoot('_applyComposerPrefillOnBoot'); @@ -181,7 +181,7 @@ def test_apply_prefill_updates_composer_and_optionally_autosends(): }); """ payload = json.loads(_run_node(source)) - assert payload["counts"] == {"autoResize": 1, "updateSendBtn": 1, "send": 1} + assert payload["counts"] == {"autoResize": 1, "updateSendBtn": 1, "send": 0} assert payload["value"] == "second pass"