WordPress / WordPress/contributor-toolkit
A dev server start whose IPC call rejects leaves the button dead for the session
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 36
- Forks
- 13
- Avg merge
- 23h 19m
- Merged PRs (30d)
- 72
Description
Description
Found by the self-review of #500, pre-existing. In startPhpServer (src/renderer/index.jsx, the catch after window.api.startServer), a rejected start clears starting and serverStartRequestedRef but never devServerActiveRef.current. The button goes back to reading Start dev server, and toggleDevServer's first guard (if (devServerActiveRef.current) return;, the #488 double-click guard) then swallows every later click silently. Nothing short of reopening the app brings the server back.
Only reachable when the IPC itself rejects (the res.ok === false path goes through stopDevServer and is fine), so it has not been seen in a pass; #500's no-watch start inherits it unchanged and does not make it more reachable.
Fix: clear devServerActiveRef.current in that catch, beside setStarting(false), and say in the Server tab that the start failed. A unit-level test needs the start decision extracted to a module first (see .github/instructions/code-review.instructions.md, renderer decisions live in modules).
Related
#500, #488.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/renderer/index.jsx at the catch after window.api.startServer in startPhpServer, then read .github/instructions/code-review.instructions.md for the renderer decision-module guidance. Ensure a rejected IPC start clears the active state and reports failure in the Server tab, and add a unit-level test after extracting the start decision to a module.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100