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 sdk-utils websocket constructor hanging #1057

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

wwilsman
Copy link
Contributor

@wwilsman wwilsman commented Sep 7, 2022

What is this?

It seems that the WebSocket constructor can sometimes cause browsers to hang during the initial handshake. This PR adjusts @percy/sdk-utils remote logger connection to start the timeout immediately, before a WebSocket is even created. This should cause the resulting promise to be rejected if the WebSocket constructor hangs for more than the default 1s timeout. This timeout is not visible outside of debug logs since remote logging connections aren't required for SDKs to work with the CLI. Unfortunately, a test for this cannot be added without blocking the event loop.

@wwilsman wwilsman added the 🐛 bug Something isn't working label Sep 7, 2022
Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

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

🏁 Gotta love those whacky browser bugs

@wwilsman wwilsman merged commit 19f8be4 into master Sep 7, 2022
@wwilsman wwilsman deleted the ww/sdk-utils-remote-logger-timeout-constructor branch September 7, 2022 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants