Checks
Problem Description
On current dev builds, JSON-RPC plugins no longer get their context menu. Right-clicking a result from a Python v2 plugin only shows Flow's own entries (Settings: , etc.), none of the plugin's.
It looks like this came from de0d022 (merged in #4057), which added [JsonIgnore] to Result.ContextData:
https://github.com/Flow-Launcher/Flow.Launcher/blob/dev/Flow.Launcher.Plugin/Result.cs
JSON-RPC plugins return results as JSON that gets deserialized into JsonRPCResult, which inherits from Result and doesn't declare ContextData itself:
https://github.com/Flow-Launcher/Flow.Launcher/blob/dev/Flow.Launcher.Core/Plugin/JsonPRCModel.cs
So ContextData from the plugin is dropped when the query response is read, and JsonRPCPluginV2.LoadContextMenus then sends context_menu with [null]. The plugin has no way to know which result was selected, so it returns nothing. The v1 JsonRPCPlugin path deserializes with System.Text.Json as well, so it's probably affected too.
v2.1.4 doesn't have the [JsonIgnore] and context menus work there.
Possible fix: have JsonRPCResult re-declare the property so it's serialized again, e.g.
public new object ContextData
{
get => base.ContextData;
set => base.ContextData = value;
}
or move the [JsonIgnore] somewhere that only affects the history results it was added for.
To Reproduce
- Run a
dev build that includes de0d022.
- Use any Python v2 plugin that sets
ContextData on its results, e.g. the Playnite plugin (https://github.com/Garulf/Playnite-Plugin), keyword pn.
- Open the context menu on a result. Only Flow's built-in entries show up.
Here is what the plugin receives for context_menu on dev:
{"jsonrpc":"2.0","id":2,"method":"context_menu","params":[null]}
On 2.1.4 params is [[{...the ContextData the plugin returned...}]], and the plugin answers with its own entries.
Flow Launcher Version
Prerelease build from dev (includes de0d022)
Windows Build Number
Not OS specific
Error Log
Nothing is logged. The call succeeds, it just carries no data.
Checks
Problem Description
On current
devbuilds, JSON-RPC plugins no longer get their context menu. Right-clicking a result from a Python v2 plugin only shows Flow's own entries (Settings: , etc.), none of the plugin's.It looks like this came from de0d022 (merged in #4057), which added
[JsonIgnore]toResult.ContextData:https://github.com/Flow-Launcher/Flow.Launcher/blob/dev/Flow.Launcher.Plugin/Result.cs
JSON-RPC plugins return results as JSON that gets deserialized into
JsonRPCResult, which inherits fromResultand doesn't declareContextDataitself:https://github.com/Flow-Launcher/Flow.Launcher/blob/dev/Flow.Launcher.Core/Plugin/JsonPRCModel.cs
So
ContextDatafrom the plugin is dropped when the query response is read, andJsonRPCPluginV2.LoadContextMenusthen sendscontext_menuwith[null]. The plugin has no way to know which result was selected, so it returns nothing. The v1JsonRPCPluginpath deserializes with System.Text.Json as well, so it's probably affected too.v2.1.4 doesn't have the
[JsonIgnore]and context menus work there.Possible fix: have
JsonRPCResultre-declare the property so it's serialized again, e.g.or move the
[JsonIgnore]somewhere that only affects the history results it was added for.To Reproduce
devbuild that includes de0d022.ContextDataon its results, e.g. the Playnite plugin (https://github.com/Garulf/Playnite-Plugin), keywordpn.Here is what the plugin receives for
context_menuon dev:{"jsonrpc":"2.0","id":2,"method":"context_menu","params":[null]}On 2.1.4
paramsis[[{...the ContextData the plugin returned...}]], and the plugin answers with its own entries.Flow Launcher Version
Prerelease build from
dev(includes de0d022)Windows Build Number
Not OS specific
Error Log
Nothing is logged. The call succeeds, it just carries no data.