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

What happens to server components if devices goes offline #5

Open
puchesjr opened this issue Dec 21, 2020 · 3 comments
Open

What happens to server components if devices goes offline #5

puchesjr opened this issue Dec 21, 2020 · 3 comments

Comments

@puchesjr
Copy link

What is the plan/strategy to handle server components in the event device goes offline? Will there be an escape hatch? Will the ui just continue to show the skeleton as example?

@puchesjr
Copy link
Author

I did watch the duration of the talk, my question is not regarding a slow network or a minor delay in the response (e.g., 3 seconds in the talk), but an actual offline scenario. For example, say I am on a train and have connectivity, but as we enter a tunnel network connectivity is lost for a prolonged period of time. On the client-side today, for example, you could fire the fetch call and if no network connectivity show a message (e.g., device off-line). As I understand the video, server components actually need to speak to the server to get the UI streamed down, so the question again is, how do you handle the scenario where I am requesting a server component when the device went offline or goes offline during the streamed response?

@threepointone
Copy link

Guessing here, but I'm guessing you'd use an ErrorBoundary, much like you would with a failing api call.

@gaearon
Copy link
Member

gaearon commented Dec 22, 2020

Yes, you could have a timeout on your network request, so that it gets rejected after some period and then you use the error boundary to show a message. You could also monitor network state specifically on the client so that you show a message in some part of UI whenever the device goes offline.

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

No branches or pull requests

3 participants