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

Use hemilabs/websocket fork of nhooyr.io/websocket #153

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

joshuasing
Copy link
Contributor

@joshuasing joshuasing commented Jun 20, 2024

Summary
Use https://github.com/hemilabs/websocket fork of nhooyr.io/websocket library

The WASM implementation of the WebSocket connection in nhooyr.io/websocket contains a bug that causes net.ErrClosed to always be returned when the connection is closed, meaning the underlying websocket.CloseError to never be returned and we can't retrieve the close code or reason. This fork contains a fix that returns the close error correctly. This patch will hopefully be upstreamed at a later date, once we are able to confirm that this fix is working correctly and doesn't change anything else.

Tested by running the web/integrationtest and providing a private key that is not authorised on the BFG server.
The exit behaviour now matches the popmd daemon.

Changes

  • Use github.com/hemilabs/websocket instead of nhooyr.io/websocket (likely temporarily)

@joshuasing joshuasing added type: bug This is a bug size: XS This change is very small (+/- <10) labels Jun 20, 2024
@joshuasing joshuasing self-assigned this Jun 20, 2024
Copy link
Contributor

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

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

OK

Copy link
Contributor

@marcopeereboom marcopeereboom left a comment

Choose a reason for hiding this comment

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

I really would like to use upstream code but for now this makes sense.

@joshuasing joshuasing merged commit 4402060 into main Jun 24, 2024
4 checks passed
@joshuasing joshuasing deleted the joshua/ws-close-error branch June 24, 2024 09:37
web3cryptoguy pushed a commit to web3cryptoguy/heminetwork that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: XS This change is very small (+/- <10) type: bug This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants