Skip to content

fix: add rejection handling to TUI promise chains - #2115

Merged
avoidwork merged 3 commits into
mainfrom
fix/unhandled-promise-rejections-tui
Nov 26, 2026
Merged

avoidwork merged 3 commits into
mainfrom
fix/unhandled-promise-rejections-tui

Conversation

@avoidwork

@avoidwork avoidwork commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Description

Adds rejection handling to three unhandled promise chains in the TUI: the gatherSystemInfo().then() call in src/tui/systemPanel.js and the two dynamic import("../provider/copilotAuth.js").then() calls in src/tui/app.js. Each chain now has a .catch() that surfaces the failure through the structured logger and respects the existing cancelled/disposed guard flags, preventing unhandled-rejection warnings or crashes when the underlying operations fail.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

Verified via npm run lint (passes, no new warnings) and npm run test (6127 tests pass). No new public functions introduced, so no new coverage required; existing line coverage maintained.

Coverage

  • Line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

Closes #2113

@avoidwork avoidwork self-assigned this Nov 26, 2026
Add .catch() handlers to the gatherSystemInfo() chain in systemPanel.js
and both dynamic import() chains in app.js so failures are surfaced
through the structured logger instead of producing unhandled rejections.
Respect the existing cancelled/disposed guard flags.
@avoidwork

Copy link
Copy Markdown
Owner Author

Audit Results

Goal fulfillment: All three unhandled promise rejections addressed.

  • src/tui/systemPanel.js — Added .catch() to the gatherSystemInfo() chain that logs the failure via logger.error and respects the cancelled flag so it does not set state after unmount.
  • src/tui/app.js:311 — Added .catch() to the Copilot auth handler registration dynamic import, logging the failure and respecting the disposed flag.
  • src/tui/app.js:332 — Added .catch() to the Copilot auth handler unregistration dynamic import in the effect cleanup, logging the failure.

Verification: npm run lint passes (no new warnings); npm run test passes (6127 tests). No new public functions introduced, so no new coverage required.

@avoidwork
avoidwork merged commit ed18b5a into main Nov 26, 2026
2 checks passed
@avoidwork
avoidwork deleted the fix/unhandled-promise-rejections-tui branch November 26, 2026 19:28
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.

fix: unhandled promise rejections in TUI panels

1 participant