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(gatsby): retry socket when connection closes #27060

Merged
merged 2 commits into from
Sep 29, 2020

Conversation

wardpeet
Copy link
Contributor

Description

Seems like we close socket.io ourselves when a disconnect happens. By default socket.io retries the connection using polling when the WebSocket fails and can recover.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Sep 25, 2020
@wardpeet wardpeet added topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) status: needs core review Currently awaiting review from Core team member and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Sep 25, 2020
@pieh
Copy link
Contributor

pieh commented Sep 28, 2020

#25862 is the PR that added the disconnect handler.

@polarathene was the socket closing only meant to prevent console spam? It's unfortunate, but closing socket prevent socket.io from reconnect attempts and I would argue is worse DX than console spam?

@polarathene
Copy link
Contributor

@pieh yes I think that was the only reason. There was a total of 3 sockets being treated like that, there shouldn't be any negative problems not closing the sockets, other than the browser continuing to poll when the dev server is not running. The core issue regarding Docker ports was resolved with an ENV var.

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

Thanks!

@pieh pieh merged commit 8d62b2c into gatsbyjs:master Sep 29, 2020
@wardpeet wardpeet deleted the chore/socket-close branch October 9, 2020 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs core review Currently awaiting review from Core team member topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants