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
{{ message }}
Repository navigation
Only do the WiFi connectivity check if the associated option is enabled #5705
If it's possible, this call should only happen when the "Synchronise only over WiFi connection" connection is enabled. Due to privacy concerns over using a Google URL for the check, we could also look at using an alternative.
Is this also the case when using File System sync? If yes, would it also be possible not to check for any connectivity when using File System sync (regardless of the WiFi setting)? The reason is that there is no need for any Internet connection when the sync target is a local folder.
If we added a check before creating the listener at startup, the app would have to be restarted for a change (of "only sync via WiFi" setting) to be effective. Am I correct?
If so, is that ok? If not, what can be done? I checked the NetInfo docs and using a React Hook will still have the same problem.
For privacy concerned people having an option to specify the check URL is important. We can use the joplinapp.org server as a default, with a setting to change the URL. Just because we say that the server does not track people doesn't mean people can verify that statement. Also, isn't the web site run by github? In which case my above 2 sentences are moot.
One thing to note though: I am not happy with the google URL either, but I believe the reason for this particular default setting in the Netinfo package was the availability of that endpoint. We all can be sure that it will be available 24x7. Can we say the same thing for other servers?
Either way, it seems that only iOS is affected by this. However, I'd be willing to make the following changes today:
set URL to joplinapp.org and make the check verify status code 200
add a Reachability URL setting for mobile to allow people to change the URL (unfortunately there's no iOS/iPadOS AppType for settings)
only add listener if the "sync only via Wifi" is set
Activity
CalebJohn commentedon Nov 10, 2021
It looks like you can also [configure the URL] (https://github.com/react-native-netinfo/react-native-netinfo/tree/371acf957cb25275395a268fd61a285e60a01acf#netinfoconfiguration) so even when it does hit a server, it can hit joplinapp instead.
tomasz1986 commentedon Nov 10, 2021
Is this also the case when using File System sync? If yes, would it also be possible not to check for any connectivity when using File System sync (regardless of the WiFi setting)? The reason is that there is no need for any Internet connection when the sync target is a local folder.
tessus commentedon Nov 10, 2021
@laurent22 I have a few questions:
If we added a check before creating the listener at startup, the app would have to be restarted for a change (of "only sync via WiFi" setting) to be effective. Am I correct?
If so, is that ok? If not, what can be done? I checked the NetInfo docs and using a React Hook will still have the same problem.
For privacy concerned people having an option to specify the check URL is important. We can use the joplinapp.org server as a default, with a setting to change the URL. Just because we say that the server does not track people doesn't mean people can verify that statement. Also, isn't the web site run by github? In which case my above 2 sentences are moot.
One thing to note though: I am not happy with the google URL either, but I believe the reason for this particular default setting in the Netinfo package was the availability of that endpoint. We all can be sure that it will be available 24x7. Can we say the same thing for other servers?
Either way, it seems that only iOS is affected by this. However, I'd be willing to make the following changes today:
laurent22 commentedon Nov 11, 2021
Yes joplinapp.org would probably be better, and yes it would be GitHub's server. For now I prefer not to add an option to set the url though.
Mobile: Fixes laurent22#5705: do WiFi connectivity check, iff option …
laurent22 commentedon Nov 29, 2021
Done a partial fix based on Tessus's pull request.