Skip to content

fix(react-devtools): let the command's own failure outrank the cleanup stop - #3559

Merged
thymikee merged 2 commits into
mainfrom
fix/react-devtools-stop-verdict
Oct 13, 2026
Merged

thymikee merged 2 commits into
mainfrom
fix/react-devtools-stop-verdict

Conversation

@thymikee

@thymikee thymikee commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Problem

react-devtools stop ran the user's action in a try/finally and cleaned the remote companion up in the finally. When both fault — the action fails and the companion could not be confirmed stopped — the cleanup failure replaces the action's failure, so the user sees teardown noise instead of the fault that actually happened.

Change

Collect both outcomes and let the action's fault win. A companion the host would not confirm stopped still fails the command when the action passed, whatever it rejects with (not only an Error). In the both-fault case the companion's verdict goes to stderr beside the thrown action fault, so nothing is discarded on either path.

Split out of #3551 to keep that PR inside its diff budget and one command family. #3551 keeps the finally shape, which already propagates an unconfirmed stop; this PR changes only which fault wins, and stops losing the other one.

Validation

  • pnpm typecheck, pnpm lint, pnpm check:affected --run pass locally at the pushed head.
  • Mutation checks: removing the stderr write fails only the ordering test; removing the stopped throw makes the action-fault path return a value it must not.

Follows up on #3551.

View guided diff Turn on auto-fix

…p stop

`react-devtools stop` ran its action in a try/finally, so a companion whose stop could not be
confirmed replaced the failure the stop was cleaning up after. Both faults are now collected and the
action's wins; the stop's verdict is still reported, whatever it rejects with, when the action passed.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/cli/commands/react-devtools.ts Outdated
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.17 MB 5.17 MB +202 B
Package (unpacked) 5.17 MB 5.17 MB +202 B
Package (download) 1.55 MB 1.55 MB +64 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.1 ms 28.5 ms +1.4 ms
CLI --help 80.7 ms 79.4 ms -1.3 ms

The precedence change dropped the stop verdict in the both-fail path: the action's fault is the
right thing to throw, but an operator who saw only `devtools package failed` never learned a
companion was still holding the bridge scope. It is now written to stderr beside the thrown fault,
on the same channel the file already uses for its wait hint.
@thymikee

Copy link
Copy Markdown
Member Author

Reviewed 817b6aa. The command's own failure now outranks the cleanup stop failure, and I found no problems in the change.

Not blocking, take or leave: the "unconfirmed stop" and "non-Error rejection" tests in src/__tests__/cli-react-devtools.test.ts also pass under the old try/finally, so only the both-fail test pins the new precedence. The both-fail path in src/cli/commands/react-devtools.ts prints only the stop error's message, so a typed reason, pid or hint is dropped.

The cubic P3 thread about discarding stopped.error is fixed at this head by the stderr write, and the test asserts that message, so you can resolve it: #3559 (comment)

CI is green and there are no conflicts. This is CLI-local control flow with a mocked companion, so no device run is needed.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 13, 2026
@thymikee
thymikee merged commit 303eeb5 into main Oct 13, 2026
19 checks passed
@thymikee
thymikee deleted the fix/react-devtools-stop-verdict branch October 13, 2026 07:45
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-13 07:46 UTC

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

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant