Skip to content

Treat Ctrl+C at a y/N prompt as no; clean up temp zips safely; remove dead code - #77

Closed
revopushbot wants to merge 1 commit into
mainfrom
feature/rev-144-safe-fixes
Closed

revopushbot wants to merge 1 commit into
mainfrom
feature/rev-144-safe-fixes

Conversation

@revopushbot

Copy link
Copy Markdown
Contributor

Part of the final clean-up (REV-144). These are small fixes that only change error paths, plus some dead code removal.

Fixes

  • Ctrl+C at a y/N prompt (ui/terminal.ts): it used to crash with TypeError: Cannot read properties of undefined (reading 'response'). Now it counts as "no", so the command prints its usual "… cancelled." message and exits 0. Only an actual Ctrl+C is handled this way. Any other prompt error still fails the command exactly as before, so a script can't mistake it for a cancel.
  • Temp zip delete after an upload (management-sdk.ts): if the file was already gone, unlinkSync threw inside the superagent callback, giving an uncaught ENOENT and a release promise that never settled. It now uses rmSync({ force: true }), best effort, so the upload's result always comes back.
  • Failed zip (management-sdk.ts): if zipping a release folder failed, a randomly named .zip was left in the current folder. It's deleted now.

Dead code

  • initiateExternalAuthenticationAsync(action, url) never used action and wasn't async. It's renamed openLoginPage(url), and loginWithExternalAuthentication loses the unused action too. The URLs are built exactly as before.
  • types/rest-definitions.ts no longer re-exports itself.

Verification

Check main This branch
Real terminal: Ctrl+C at "remove this app? (y/N)" TypeError stack trace, exit 1 "App removal cancelled.", exit 0
No terminal (stdin closed) at the same prompt exits 0 silently same
45 CLI commands against a fake server Same output and server requests Same output and server requests
  • New tests: test/terminal.ts covers y, an empty answer, Ctrl+C and other prompt errors. test/management-sdk.ts covers the partial zip being deleted and an upload whose zip is already gone. The three fix tests fail on main.
  • Tests: all 165 pass on macOS and on Linux (Docker, Node 20.19.0).
  • Build, lint and format: tsc, lint and format are clean.

🤖 Generated with Claude Code

… dead code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@revopushbot

Copy link
Copy Markdown
Contributor Author

Included in #78 (commit a0cf51c), so I'm closing this one.

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