Skip to content

feat: add graceful fallback for isows dependency #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mandarini
Copy link

@mandarini mandarini commented Aug 1, 2025

What kind of change does this PR introduce?

Bug fix - adds compatibility for server environments where isows is not available.

What is the current behavior?

RealtimeClient fails when isows is not available in server environments, causing Cannot find module 'isows' errors and preventing the client from being instantiated.

What is the new behavior?

RealtimeClient gracefully falls back to alternative WebSocket implementations when isows is unavailable:
• Uses window.WebSocket in browser environments
• Uses global.WebSocket if globally available
• Falls back to Node.js ws package
• Maintains optimal performance by preferring isows when available

Additional context

  • All existing tests pass, ensuring no regressions.
  • Checked against this test PR
  • Maintains backward compatibility - existing code continues to work unchanged
  • No breaking changes to the public API

@mandarini mandarini self-assigned this Aug 1, 2025
@mandarini mandarini marked this pull request as ready for review August 1, 2025 13:51
@mandarini mandarini linked an issue Aug 1, 2025 that may be closed by this pull request
2 tasks
@mandarini mandarini requested a review from grdsdev August 1, 2025 13:54
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.

Cannot find package "isows"
1 participant