fix: do not leak the action keyword into the v2 query search string#31
Merged
Conversation
When the user has typed only the action keyword, Flow Launcher sends
{'search': '', 'trimmedQuery': '<kw>'}. The falsy-or fallback to
trimmedQuery handed the keyword to the plugin's query handler, since
trimmedQuery (and its obsolete alias rawQuery) always include the
action keyword while Query.search never does.
Claude-Session: https://claude.ai/code/session_016BXjCFiQ5jaCjkaFmCZGyF
Garulf
added a commit
that referenced
this pull request
Jul 13, 2026
) When the user has typed only the action keyword, Flow Launcher sends {'search': '', 'trimmedQuery': '<kw>'}. The falsy-or fallback to trimmedQuery handed the keyword to the plugin's query handler, since trimmedQuery (and its obsolete alias rawQuery) always include the action keyword while Query.search never does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
python_v2protocol received the action keyword as their query string when the user had typed only the keyword (e.g.wiki).Queryobject;searchexcludes the action keyword, buttrimmedQuery/rawQueryinclude it. The falsyorfallback totrimmedQueryfired wheneversearchwas an empty string, leaking the keyword to the handler.trimmedQueryfallback entirely — it can never be the correct search string.Test plan
test_action_keyword_not_leaked_into_searchreplays the real wire message ({'search': '', 'trimmedQuery': 'kw', ...}) and asserts the handler receives''(failed with['kw'] != ['']before the fix)