Commit Graph
1 Commits
Author SHA1 Message Date
Neil 186b18e2b9 fix(plugins): stop a late replacing command from repeating the built-in action (#39407)
* fix(plugins): stop a late replacing command from repeating the built-in action

The renderer ran Orca's own action after 2 s but the still-running replacing
command could then call commands.run for the same action, doing it twice.
Main now owns the 2 s cutoff: it rejects at the deadline (the renderer falls
back on that answer) and from then refuses the late handler's commands.run of
the replaced action; a handler that already ran the action is not followed by a
fallback. The deadline now starts when the renderer asked, not after plugins
load. The renderer's own timer is only a safety net. (STA-13530)

* test(plugins): cover replacement races and verify the sidebar toggles once end to end

A handler's commands.run now counts for the oldest in-flight press only, so a second
concurrent press whose handler fails still gets Orca's fallback. Adds unit cases for a
throwing/crashed handler, two presses racing, and a press after a late handler returns,
plus an Electron e2e spec driving fast, late (2.1 s), throwing and no-op replacements of
sidebar.left.toggle.
2026-11-07 02:50:17 -08:00