Skip to content

fix: ensure OAuth server cleanup on error before callback resolves - #5

Merged
gnapse merged 1 commit into
mainfrom
fix/oauth-server-cleanup
Jan 16, 2026
Merged

fix: ensure OAuth server cleanup on error before callback resolves#5
gnapse merged 1 commit into
mainfrom
fix/oauth-server-cleanup

Conversation

@gnapse

@gnapse gnapse commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Expose cleanup function from startCallbackServer so callers can stop the server on error
  • Wrap OAuth flow in try-catch and call cleanup when open() or subsequent steps throw before the callback promise settles
  • Prevents server from running until 3-minute timeout when errors occur early in the flow

Test plan

  • npm run type-check passes
  • npm test passes (551 tests)
  • Added new test: 'calls cleanup when open() throws'

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gnapse
gnapse requested a review from henningmu January 16, 2026 11:43
@gnapse gnapse self-assigned this Jan 16, 2026
@gnapse gnapse added the 👀 Show PR PR must be reviewed before or after merging label Jan 16, 2026
@gnapse
gnapse merged commit ac38547 into main Jan 16, 2026
@gnapse
gnapse deleted the fix/oauth-server-cleanup branch January 16, 2026 11:44
@gnapse gnapse mentioned this pull request Jan 16, 2026
4 tasks

@henningmu henningmu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants