Skip to content

fix(plugins): show a starting plugin's refusal immediately - #403

Merged
fcoury merged 1 commit into
mainfrom
fix/rpc-lazy-init-windows
Oct 17, 2026
Merged

fcoury merged 1 commit into
mainfrom
fix/rpc-lazy-init-windows

Conversation

@fcoury

@fcoury fcoury commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

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 x is still starting and already has a command waiting…". That warning used the default display priority. The foreground "plugin x is 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_responsive keeps initialize pending 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

  • The refusal from start_rpc_command is now published as a routine foreground warning, the same way as the "is starting" notice it replaces. It used to be queued as a plugin PrintWarning action. Measured on my Mac, the warning now appears 9.5 ms after the keypress instead of 4.0 s.
  • The test now asserts that the warning is on screen as soon as the keypress has been handled, instead of polling for it. That checks the behaviour directly, without depending on timing.

How to Test

  1. cargo test --test rpc_connection passes.
  2. Regression check: revert the src/editor.rs change and run the test again. It fails at the new assertion, because the screen still shows only "is starting".
  3. By hand, with any RPC plugin whose initialize is 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.
  4. CI: the Windows test suite should go green here.

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.
@fcoury
fcoury merged commit 8a0aad0 into main Oct 17, 2026
12 checks passed
@fcoury
fcoury deleted the fix/rpc-lazy-init-windows branch October 17, 2026 01:00
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