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

Simple refresh page when sw detects offline #8765

Closed
ThatOneCalculator opened this issue May 30, 2022 · 4 comments · Fixed by #13052
Closed

Simple refresh page when sw detects offline #8765

ThatOneCalculator opened this issue May 30, 2022 · 4 comments · Fixed by #13052
Labels
✨Feature This adds/improves/enhances a feature

Comments

@ThatOneCalculator
Copy link
Contributor

Summary

Right now, when Misskey's offline, it just shows a single line message:

.catch(() => new Response(`Offline. Service Worker @${_VERSION_}`, { status: 200 }))

If there's a way it could instead respond with a basic page like this, it'd be a lot more user friendly:

image

@ThatOneCalculator ThatOneCalculator added the ✨Feature This adds/improves/enhances a feature label May 30, 2022
@Johann150
Copy link
Contributor

I think it might also be nice to show the reason why the service worker thinks you are offline. Because currently any fetch error will cause the service worker to think you are offline.

Noticed this when I did not renew my TLS certificate on time and got the "Offline" screen.

@tamaina
Copy link
Contributor

tamaina commented May 30, 2022

fetchは、サーバーが4xxや5xxを応答した時はresolveになります。fetchがreject(error)になるのは、(主としてユーザーの)回線に問題があるときです。これはofflineと言っていい状況です。

@YokaiRick
Copy link

YokaiRick commented Jun 1, 2022

@ThatOneCalculator dunno if i understand you correctly, but you actually can already set a warning page like you suggested:


@Johann150
Copy link
Contributor

That warning will only be shown when the web client detects that the server goes offline while you are already using the client. The service worker error shown above would be shown when the server is already offline when you navigate to the website and the service worker is already cached in your browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature This adds/improves/enhances a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants