Skip to content

Fix reconnection to Ergo servers on web client#140

Closed
seisatsu wants to merge 1 commit into
obbyworld:mainfrom
seisatsu:fix-ergo-reconnect
Closed

Fix reconnection to Ergo servers on web client#140
seisatsu wants to merge 1 commit into
obbyworld:mainfrom
seisatsu:fix-ergo-reconnect

Conversation

@seisatsu
Copy link
Copy Markdown

@seisatsu seisatsu commented Feb 14, 2026

Resolves #139 by adding Ergo IRCd's default secure websocket port 8097 to the list of ports automatically marked as wss:// in ensureUrlFormat().

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced WebSocket connection security by ensuring port 8097 uses encrypted secure connections.

Resolves #139 by adding Ergo IRCd's default secure websocket port 8097 to the list of ports automatically marked as wss:// in ensureUrlFormat().
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

The ensureUrlFormat function in the store now treats port 8097 as a secure port for non-localhost hosts, causing WebSocket connections to use the wss scheme instead of ws.

Changes

Cohort / File(s) Summary
WebSocket Secure Port Handling
src/store/index.ts
Modified port detection logic to include port 8097 as a secure port, ensuring connections to this port use wss instead of ws for non-localhost hosts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A websocket on 8097,
Was mistakenly sent down the insecure path,
But now with our fix, it's heaven—
Secure channels flow, no more wrath!
Port by port, we make things right, 🔐

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 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 to Ergo servers by ensuring secure WebSocket protocol usage.
Linked Issues check ✅ Passed The PR directly addresses issue #139 by adding port 8097 to secure WebSocket ports, ensuring wss:// is used for Ergo's default secure WebSocket port.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to fixing the specific issue: treating port 8097 as secure in the ensureUrlFormat function with no unrelated modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

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.

Comment thread src/store/index.ts
Comment on lines 68 to 71
? "ws"
: port === 6697 || port === 9999 || port === 443 || port === 993
: port === 6697 || port === 9999 || port === 443 || port === 993 || port === 8097
? "wss"
: "ws";
Copy link
Copy Markdown
Contributor

@matheusfillipe matheusfillipe Feb 14, 2026

Choose a reason for hiding this comment

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

This was actually uninteneded. We dont want to support unsafe websockets except if local testing.

IMO should be just

    ? "ws"
    : "wss";

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.

Web client wrongly attempts to reconnect to certain saved servers using insecure websockets on start, leading to error

2 participants