Skip to content

Conversation

@alepane21
Copy link
Contributor

@alepane21 alepane21 commented Jan 29, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error handling to ensure proper shutdown and data flushing when the application encounters an error, improving reliability and preventing potential data loss.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

Walkthrough

The catch block in the CLI's main entry point now awaits the telemetry shutdown function before exiting, rather than immediately setting the exit code. This ensures telemetry is properly flushed before the process terminates.

Changes

Cohort / File(s) Summary
Error handling
cli/src/index.ts
Updated catch block to await shutdownTelemetry() before exit, replacing synchronous process.exitCode assignment to ensure telemetry is flushed before process termination.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title states 'exit immediately' but the actual change makes the process wait for shutdownTelemetry() to complete before exiting, which contradicts the described behavior. Revise the title to accurately reflect that telemetry shutdown now completes before exit, such as 'fix: await telemetry shutdown before exiting on error.'
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 28.34%. Comparing base (fd9302f) to head (7db066c).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cli/src/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2478       +/-   ##
===========================================
- Coverage   63.20%   28.34%   -34.87%     
===========================================
  Files         296      127      -169     
  Lines       41480    11144    -30336     
  Branches     4312      243     -4069     
===========================================
- Hits        26219     3159    -23060     
+ Misses      15239     7981     -7258     
+ Partials       22        4       -18     
Files with missing lines Coverage Δ
cli/src/index.ts 0.00% <0.00%> (ø)

... and 422 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alepane21 alepane21 changed the title fix: if an error is caught, exit immediately. fix: if an error is caught, exit immediately Jan 29, 2026
Copy link
Contributor

@SkArchon SkArchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JivusAyrus JivusAyrus merged commit 3816a75 into main Jan 30, 2026
27 checks passed
@JivusAyrus JivusAyrus deleted the ale/eng-8841-cli-hangs-on-error branch January 30, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants