[enhancement] Edge case for loader refetch errors (offline mode?) #2918
Replies: 6 comments 2 replies
-
I think Remix can just be smarter here and say "hey the user is offline, so this may fail, let's try anyway in case the app works offline but if it fails do it silently". Doing this will open the door to make offline apps easier, you could for example cache in a Service Workers your loaders or keep some queue of pending mutations there. This way Remix doesn't even need to know that exists, you make your app as if it was always online, Remix ensure in case you are offline and already loaded a page that page will keep loaded and you can add your offline features in the SW. |
Beta Was this translation helpful? Give feedback.
-
Are there any plans for Remix apps to leverage Service Workers? This case could then be handled by responding to the app that the request was received and |
Beta Was this translation helpful? Give feedback.
-
Are there any updates on this issue? I am studying remix, and my only concern so far is that it might not be suitable for PWA apps that needs some offline functionalities (yet). |
Beta Was this translation helpful? Give feedback.
-
I am using fetcher to load data periodically on a page to refresh it with latest information from the server. I am not sure how to handle network errors in this case. Currently if the browser goes offline while refresh is in progress, the error thrown is caught by error boundary, but in this case I would still like to show user the stale data. I am not sure if I am doing things in the "Remix way" so apologies in advance. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Is there anything new about this? Apart from using something like |
Beta Was this translation helpful? Give feedback.
-
This is stinging us a lot, sometimes with users that are not actually offline, running into Sentry just shows this error, and it's very hard to figure out how to handle this.
Remix also throws this sometimes after a
This is my error boundary: export function ErrorBoundary() {
const error = useRouteError();
captureRemixErrorBoundaryError(error);
// when true, this is what used to go to `CatchBoundary`
if (isRouteErrorResponse(error)) {
return (
<div>
<p>Status: {error.status}</p>
<pre>{JSON.stringify(error.data)}</pre>
</div>
);
}
return (
<div>
<h1>Uh oh ...</h1>
<p>Something went wrong.</p>
<pre>{`${error}`}</pre>
</div>
);
} |
Beta Was this translation helpful? Give feedback.
-
Ok, this one's tricky and I'm not sure what do about it. I got an email from one of my users with a situation they ran into on my site:
Here's what I said to them:
Like I said, I'm not sure what to do about this, but I think what I might want is the ability to say: "go ahead and refetch the data, but if it fails, then ignore it" ?? maybe? Definitely open to other ideas here. I'm not sure whether a change is needed in remix...
Thinking about the use case more holistically, if I wanted to build an offline supported version of my app, I would need some way to tell Remix to not attempt to make network requests when the user is offline.
Beta Was this translation helpful? Give feedback.
All reactions