Skip to content

fix: do not leak the action keyword into the v2 query search string#31

Merged
Garulf merged 1 commit into
mainfrom
fix/v2-keyword-in-query
Jul 13, 2026
Merged

fix: do not leak the action keyword into the v2 query search string#31
Garulf merged 1 commit into
mainfrom
fix/v2-keyword-in-query

Conversation

@Garulf

@Garulf Garulf commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Plugins using the python_v2 protocol received the action keyword as their query string when the user had typed only the keyword (e.g. wiki ).
  • Flow Launcher serializes the whole Query object; search excludes the action keyword, but trimmedQuery/rawQuery include it. The falsy or fallback to trimmedQuery fired whenever search was an empty string, leaking the keyword to the handler.
  • Drop the trimmedQuery fallback entirely — it can never be the correct search string.

Test plan

  • New regression test test_action_keyword_not_leaked_into_search replays the real wire message ({'search': '', 'trimmedQuery': 'kw', ...}) and asserts the handler receives '' (failed with ['kw'] != [''] before the fix)
  • Full suite passes (135 tests)

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
Garulf merged commit 1a1e31c into main Jul 13, 2026
5 checks passed
@Garulf
Garulf deleted the fix/v2-keyword-in-query branch July 13, 2026 08:50
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant