Skip to content
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

Fix roon API test app for latest browser WebSocket and Roon API changes #6

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

Conversation

trisweb
Copy link

@trisweb trisweb commented Mar 5, 2023

  • Add polyfills for the native WebSocket browser implementation to be compatible with nodejs ws methods that the Roon API library uses
  • Add periodic reconnect (every 8 seconds) to get around disconnect every 10 seconds due to inability of browser WebSocket to send a Ping often enough. Unfortunately there is not a solution to this without changing the Roon API behavior.

Works fine with these changes and is actually a great app for Roon; however the view flashes every 8 seconds and works perfectly smoothly to boot.

See issue RoonLabs/node-roon-api#34 for core issue with roon js API using non-native WebSocket methods. Though, it is billed as a "node roon API" so not sure if that's in scope.

trisweb added 2 commits March 5, 2023 10:56
* Add polyfills for the native WebSocket browser implementation to be compatible with nodejs ws methods that the Roon API library uses
* Add periodic reconnect (every 8 seconds) to get around disconnect every 10 seconds due to inability of browser WebSocket to send a Ping often enough. Unfortunately there is not a solution to this without changing the Roon API behavior.

Works fine with these changes and is actually a great app for Roon; however the view flashes every 8 seconds.

See issue RoonLabs/node-roon-api#34 for core issue with roon js API using non-native WebSocket methods. Though, it is billed as a "node roon API" so not sure if that's in scope.
@@ -1,2 +1,5 @@
node_modules
bundle.js
.cache/
package-lock.json
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not a good thing to add... package-lock.json should always be committed.

Copy link
Author

Choose a reason for hiding this comment

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

Apologies, will revert.

@dannydulai
Copy link
Contributor

what browsers is this not compatible with?

@trisweb
Copy link
Author

trisweb commented Jul 17, 2023

(Sorry for the notification spam, wrong github account)

@dannydulai it's been a while since I looked at this but as I had tested, it was the latest rolling release of Chrome that it was not working with. I expect there are differences between node.js's implementation of websockets and nearly all browser-based implementations.

I can test again and with other browsers and report back, but the general conclusion is the code in master isn't compatible with modern browsers as-is.

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