Repository navigation
fix(plugins): show a starting plugin's refusal immediately - #403
Merged
Merged
Conversation
A second command sent to an RPC plugin that is still starting was refused with a default-priority warning, which the foreground "is starting" notice hid until it expired about 4 seconds later. The refusal answers the keypress, so it now replaces that notice right away. The delay also left the lazy-initialization test about 1 second before the plugin's 5-second initialize timeout, which slower Windows runners now exceed.
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.
Why
If you run a command on an RPC plugin that is still starting, and that plugin already has a command waiting, Red refuses it with "plugin
xis still starting and already has a command waiting…". That warning used the default display priority. The foreground "pluginxis starting" notice from the first keypress hid it until that notice expired, about 4 seconds later. For those 4 seconds the second keypress showed no feedback at all.The same delay broke CI.
rpc_connection→lazy_initialization_keeps_input_responsivekeepsinitializepending while it checks the editor. On my Mac, waiting for the hidden warning took 4.0 s, leaving about 1 s before the plugin's 5 s initialize timeout. The Windows runners now exceed that, and the test fails on main's code as well (re-running PR #401's Windows job failed the same way). This is what blocks #402.What
start_rpc_commandis now published as a routine foreground warning, the same way as the "is starting" notice it replaces. It used to be queued as a pluginPrintWarningaction. Measured on my Mac, the warning now appears 9.5 ms after the keypress instead of 4.0 s.How to Test
cargo test --test rpc_connectionpasses.src/editor.rschange and run the test again. It fails at the new assertion, because the screen still shows only "is starting".initializeis slow: run one of its commands, then run it again straight away. The second press shows "is still starting and already has a command waiting" immediately.