fix(local): re-emit SIGINT/SIGTERM after cleanup in verify mode#1073
Merged
Conversation
SIGINT during --verify or post-init verification was forwarded to the child process but never re-emitted, so the CLI continued normally after cleanup instead of terminating. Track the received signal and re-emit it via process.kill(process.pid, signal) after all cleanup (child kill, server shutdown, listener removal) completes.
Contributor
|
Contributor
Codecov Results 📊❌ Patch coverage is 20.00%. Project has 4769 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 81.58% 81.55% -0.03%
==========================================
Files 369 369 —
Lines 25829 25845 +16
Branches 16884 16888 +4
==========================================
+ Hits 21070 21076 +6
- Misses 4759 4769 +10
- Partials 1770 1769 -1Generated by Codecov Action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SIGINT/SIGTERM during
--verifymode or post-init verification was forwarded to the child process but never re-emitted afterward. After cleanup completed, the CLI continued normally instead of terminating — the user's Ctrl+C was silently swallowed.This fix tracks the received signal and re-emits it via
process.kill(process.pid, signal)after all cleanup (child kill, server shutdown, listener removal) completes, so the default handler terminates the process with the correct exit code.Fixes both
src/commands/local/run.ts(runWithVerify) andsrc/lib/init/verify-setup.ts(verifySetup).Testing
vitest run test/commands/local/run.test.ts— 12 tests passvitest run test/lib/init/wizard-runner.test.ts test/lib/dev-script.test.ts test/lib/dev-script.property.test.ts— 57 tests passpnpm run lint— cleantsc --noEmit— no errors (excluding pre-existing generated-file issues)Addresses warden findings from #998.