Skip to content

Apply and rebuild silently does nothing while the dev server is running #262

Closed

Description

@juanmaguitar

What happens

With the dev server running, clicking Apply and rebuild on a patch or PR does nothing useful. The apply panel stays exactly as it was, and the only feedback is a single line in the terminal:

A command is already running. Press Ctrl+C to stop it.

Nothing is surfaced in the UI, so it reads as the button being broken rather than as a state you need to leave first.

Why

The terminal tracks one "a command is running" flag. Starting the dev server sets that flag and keeps it set for the whole life of the watcher (grunt _watch). The apply handler refuses to run while the flag is set and bails with the terminal message — but the Apply and rebuild button is never disabled for that state, so it stays clickable and gives no visible reason for doing nothing.

The Update to latest trunk button already handles the same situation correctly: it disables while the dev server is active and shows a "Stop the dev server before updating" tooltip. The apply action just never got the same guard.

Root cause

  • src/renderer/index.jsx — the Apply and rebuild button disables only on the update/install/build states, not on the dev-server-active state.
  • src/renderer/index.jsx — runApply guards on the terminal's running flag and writes the "already running" line without surfacing anything in the panel.
  • src/renderer/index.jsx — the dev server sets that flag for its full lifetime, so it is true the entire time the watcher runs.

The same missing guard applies to the revert path and the per-PR "Apply…" buttons in the linked-PR list, since they share the same flow.

Expected

While the dev server is running, the apply actions should make it obvious you can't apply yet — the same way the trunk update button does — instead of appearing clickable and silently failing.

Steps to reproduce

  1. Start the dev server.
  2. Open a Trac ticket, pick a linked PR, and preview it.
  3. Click Apply and rebuild.
  4. Nothing changes in the panel; the terminal prints "A command is already running."

Activity

  1. juanmaguitar commented on Aug 11, 2026

    @juanmaguitar
    CollaboratorAuthor

    Same root cause as #247

    This is a symptom of the watcher holding the single terminal "running" slot for its whole life. While the dev server is up, that slot is taken, so apply is refused — the "A command is already running" line comes from that guard.

    The preferred fix is not "stop the server so apply can run." For a patch that only touches src/, the running watcher already rebuilds the change, so the standalone build the apply flow forces is redundant. The real fix is to decouple the watcher from the terminal slot — see the design proposal in #247 (give the watcher its own tab). Once that lands, this case stops being blocked on its own.

    A stop-gap in the meantime: disable the Apply and rebuild button while the dev server is active and explain why, the same way Update to latest trunk already does — so the action is not silently refused. The same guard is missing on the revert path and the per-PR "Apply…" buttons, which share the flow.

    Depends on / tracked by #247.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions