Skip to content

fix: improve error handling when OAuth callback port is in use#17

Merged
steipete merged 1 commit intosteipete:mainfrom
kiranjd:fix/port-in-use-handling
Jan 16, 2026
Merged

fix: improve error handling when OAuth callback port is in use#17
steipete merged 1 commit intosteipete:mainfrom
kiranjd:fix/port-in-use-handling

Conversation

@kiranjd
Copy link
Copy Markdown
Contributor

@kiranjd kiranjd commented Jan 9, 2026

Problem

  1. Press Sign in in app
  2. Redirects to GitHub
  3. Login succeeds
  4. Triggers redirect to localhost:53682/callback
  5. "Site can't be reached" - callback server never started because port was held by stale connection

image

Fix

  • Check if port is available before binding
  • Throw clear error: "Port 53682 is already in use. Try again in a few seconds, or specify a different port with --loopback-port."

- Add LoopbackServerError enum with descriptive error messages
- Check if port is available before attempting to bind
- Provide actionable error message suggesting --loopback-port flag

Fixes issue where stale connections holding the OAuth callback port
cause silent failures with unhelpful 'site can't be reached' errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kiranjd
Copy link
Copy Markdown
Contributor Author

kiranjd commented Jan 9, 2026

Screenshot of the error
image

@steipete
Copy link
Copy Markdown
Owner

Thanks Kiran!

@steipete steipete merged commit a603e59 into steipete:main Jan 16, 2026
2 checks passed
@steipete
Copy link
Copy Markdown
Owner

Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: d39a19f\n- Merge commit: a603e59\n\nFollow-up cherry-pick onto main to include test + messaging adjustments.\n\nThanks @kiranjd!

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.

2 participants