Skip to content

fix(local): re-emit SIGINT/SIGTERM after cleanup in verify mode#1073

Merged
MathurAditya724 merged 1 commit into
mainfrom
fix/verify-sigint-reemit
Jun 5, 2026
Merged

fix(local): re-emit SIGINT/SIGTERM after cleanup in verify mode#1073
MathurAditya724 merged 1 commit into
mainfrom
fix/verify-sigint-reemit

Conversation

@MathurAditya724

Copy link
Copy Markdown
Member

Summary

SIGINT/SIGTERM during --verify mode 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) and src/lib/init/verify-setup.ts (verifySetup).

Testing

  • vitest run test/commands/local/run.test.ts — 12 tests pass
  • vitest run test/lib/init/wizard-runner.test.ts test/lib/dev-script.test.ts test/lib/dev-script.property.test.ts — 57 tests pass
  • pnpm run lint — clean
  • tsc --noEmit — no errors (excluding pre-existing generated-file issues)

Addresses warden findings from #998.

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.
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1073/

Built to branch gh-pages at 2026-06-05 02:32 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

❌ Patch coverage is 20.00%. Project has 4769 uncovered lines.
❌ Project coverage is 81.55%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
src/lib/init/verify-setup.ts 0.00% ⚠️ 10 Missing
src/commands/local/run.ts 40.00% ⚠️ 6 Missing and 1 partials
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        -1

Generated by Codecov Action

@MathurAditya724 MathurAditya724 marked this pull request as ready for review June 5, 2026 02:59
@MathurAditya724 MathurAditya724 merged commit a085e1f into main Jun 5, 2026
25 of 26 checks passed
@MathurAditya724 MathurAditya724 deleted the fix/verify-sigint-reemit branch June 5, 2026 03:00
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