You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visit wp-admin so that service worker is installed
Stop nginx
Refresh
You'll see:
You seem to be offline.
Please check your internet connection. In the future, this error screen could provide you with actions you can perform while offline, like edit recent drafts in Gutenberg.
That's misleading, because it makes the user think the problem is on their end, rather than the server's.
Off the top of my head, I'm not sure if it's practical to try and detect the difference, but I figured I'd mention it. I guess the browser could attempt an OPTIONS HTTP request to wordpress.org or something, as a quick way to test if the user is actually offline.
The text was updated successfully, but these errors were encountered:
Humm. I should think rather that an error template should be used here rather than the offline template. I presume the admin request is returning with a 0 status code?
OK, I suppose this makes sense given how it is architected right now. When a fetch() fails due to the server not responding, there is no difference between whether you are offline or the server is offline.
So I think the simple fix is to check for navigator.onLine when the request fails. If it is true then we know it is actually the server that is offline (probably) and we can show a message related to that; otherwise, if it is false then we know the user is offline and we can show the same message as we do presently.
wp-admin
so that service worker is installedYou'll see:
That's misleading, because it makes the user think the problem is on their end, rather than the server's.
Off the top of my head, I'm not sure if it's practical to try and detect the difference, but I figured I'd mention it. I guess the browser could attempt an
OPTIONS
HTTP request towordpress.org
or something, as a quick way to test if the user is actually offline.The text was updated successfully, but these errors were encountered: