Skip to content

refactor: add socket factory seam under IRC transport#177

Open
louzt wants to merge 1 commit into
obbyworld:mainfrom
louzt:feat/socket-transport-seam
Open

refactor: add socket factory seam under IRC transport#177
louzt wants to merge 1 commit into
obbyworld:mainfrom
louzt:feat/socket-transport-seam

Conversation

@louzt
Copy link
Copy Markdown

@louzt louzt commented Apr 23, 2026

Summary

This PR opens a narrow transport seam under ObsidianIRC's existing socket layer without changing default behavior.

What changes

  • keeps the current routing exactly as-is:
    • wss:// -> WebSocketWrapper
    • irc:// / ircs:// -> TCPSocket
  • adds an injectable SocketFactory
  • adds focused tests for:
    • custom factory injection
    • default websocket routing
    • default tauri TCP/TLS routing

Why

ObsidianIRC already has protocol selection, but the routing was still effectively hardcoded.
An injectable seam makes future transport experimentation and testing cleaner while preserving current behavior.

This mirrors the same direction already applied in the related tobby refactor, but fits ObsidianIRC's existing architecture where WebSocket support already exists.

Verification

  • npm run format
  • npm run fix:unsafe
  • npm run test
  • npm run build

Notes

The full test suite passes, though the repository already emits pre-existing jsdom/React test warnings around HTMLMediaElement.prototype.pause and some act(...) coverage in unrelated tests.

Keep the existing default TCP/TLS and WebSocket routing unchanged, but expose an injectable socket factory so alternate transports can be integrated and tested without rewriting IRC client logic.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@louzt has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 17 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 17 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c70c252-7c6e-4950-8aed-989823f34daf

📥 Commits

Reviewing files that changed from the base of the PR and between e7d7899 and e0d81ef.

📒 Files selected for processing (2)
  • src/lib/socket.ts
  • tests/lib/socketFactory.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

1 participant