Skip to content

Fix the reconnection issue for websocket ports outside predefined ones#143

Merged
matheusfillipe merged 1 commit into
obbyworld:mainfrom
salihgerdan:main
Feb 21, 2026
Merged

Fix the reconnection issue for websocket ports outside predefined ones#143
matheusfillipe merged 1 commit into
obbyworld:mainfrom
salihgerdan:main

Conversation

@salihgerdan
Copy link
Copy Markdown
Contributor

@salihgerdan salihgerdan commented Feb 21, 2026

Resolves issue #139 as per matheusfillipe's recommendation in PR #140, which has been silent for a week now.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Enhanced WebSocket connection handling for improved consistency between local and remote environments.

…s, always secure connection if not localhost
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 21, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The ensureUrlFormat function in src/store/index.ts was simplified to remove port-based heuristics for WebSocket scheme selection. The function now always defaults to "ws" for localhost and "wss" for non-localhost, eliminating conditional logic that previously checked specific ports (6697, 9999, 443, 993).

Changes

Cohort / File(s) Summary
WebSocket Scheme Logic Simplification
src/store/index.ts
Refactored ensureUrlFormat to replace port-dependent scheme selection with a simpler localhost-based approach. Non-localhost hosts now always default to secure "wss" scheme; localhost defaults to insecure "ws" scheme. Added clarifying comments on the intent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 No more ports to count and peek,
Just localhost checks, sleek and chic!
Secure by default for the distant lands,
While local friends don't need such strands.
One less branch, the code runs free! 🌙

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing reconnection for non-predefined websocket ports by removing port-based heuristics and using localhost-based scheme selection instead.
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 (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@matheusfillipe matheusfillipe merged commit be9d61d into obbyworld:main Feb 21, 2026
1 check passed
@matheusfillipe matheusfillipe mentioned this pull request Feb 24, 2026
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