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

remove hanging if no connection #1

Merged
merged 1 commit into from Jan 19, 2021
Merged

Conversation

rsbondi
Copy link
Contributor

@rsbondi rsbondi commented Jan 19, 2021

await untilOpen would cause to hang if there was an error. This would cause the UI to hang even if other relays were connected, since the await is in a loop.

The key to this PR is adding the rejectOpen(also renamed isOpen to resolveOpen for clarity), this will keep the hang up. This will more than likely have upstream effects but less severe than the hang, additional handling most likely needed in the client app, but it appears to work for now.

Also, I wrapped the await in the trySend which has additional checks for the web socket status.

This will also try to reconnect on an interval if previous connection failed.

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.

None yet

2 participants