Skip to content

fix(core): close stale watcher after shortcut restart#8153

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-shortcut-restart-watcher
Jul 21, 2026
Merged

fix(core): close stale watcher after shortcut restart#8153
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-shortcut-restart-watcher

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

This PR prevents successful CLI shortcut restarts from leaving the previous restart watcher active. It closes the old watcher only after the replacement server starts successfully, preserving failed-restart retries, and adds focused end-to-end coverage.

Related Links

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f30edefe-3add-4e14-8e8c-f1c9204878c5

📥 Commits

Reviewing files that changed from the base of the PR and between ba3eabc and f4bf528.

📒 Files selected for processing (6)
  • e2e/cases/cli/shortcut-restart-watcher/dev.js
  • e2e/cases/cli/shortcut-restart-watcher/index.test.ts
  • e2e/cases/cli/shortcut-restart-watcher/rsbuild.config.mjs
  • e2e/cases/cli/shortcut-restart-watcher/src/index.js
  • packages/core/src/build.ts
  • packages/core/src/server/devServer.ts

📝 Walkthrough

Walkthrough

The change separates build and server resource cleanup from complete shutdown, keeping restart watchers active for retryable restarts and closing them during full shutdown. CLI shortcut wiring now uses a dedicated restart helper. A new end-to-end case configures file-based restart watching, launches the CLI in development mode, triggers a keyboard restart, modifies the watched file, and verifies the restart logs.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the core fix: closing the stale watcher after shortcut restart.
Description check ✅ Passed The description matches the PR by explaining the stale watcher fix and the added end-to-end coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chenjiahan
chenjiahan merged commit a47f209 into main Jul 21, 2026
7 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/fix-shortcut-restart-watcher branch July 21, 2026 05:36
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