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
Display a notification when a user goes offline #8081
Comments
Rather than make a new route in Site Kit, and increase traffic to the user's site (which also could be, in theory, not on the public internet), is there any reason not to use something like We can ping the WordPress site instead but I figured something online (and something that already exists for this purpose) seems better, plus is less code for us to maintain. That URL is what I originally proposed in #3820, for what it's worth 😄 |
Hi @tofumatt, the reason why this was switch to backend call in the original implementation as well, was due to the CORS issue with external services (Google and WordPress ones), and for better reliability. But I haven't tried with apple due to the comments, that since this is Google plugin, we should not use Apple service endpoint. Although I did try it now, and that endpoint seems to be the only one without CORS issue. But we don't have guarantees it might not change in the future. So for reliability and better control, I suggested doing the REST endpoint. Techically we could switch to Apple endpoint, if you think above concerns might not be the issue Let me know what you think |
Ah, fair enough. Using the Apple endpoint I don't really think is an issue, but the CORS issue is an interesting point. IB ✅ |
QA Update ✅
Recording.747.mp4 |
Feature Description
This issue is a follow-up to #3820 which introduced the foundational infrastructure. See #8033 (review)
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
includes/Core/Util/Health_Checks.php
, add new route, saycore/site/data/connection-checks
. It should return the text "true".assets/js/hooks/useMonitorInternetConnection.js
, updatecheckInternetConnection
callback function to useAPI
fromgooglesitekit-api
instead ofapiFetch
.API.get
to theconnection-checks
, and explicitly passuseCache
with valuefalse
onlineResponse
and it's usage and passtrue
directly tosetIsOnline
, since if entered here, request was successful. Otherwise error will be caught and set tofalse
.useMonitorInternetConnection
to theDashboardMainApp
andDashboardEntityApp
componentsTest Coverage
useMonitorInternetConnection.test.js
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: