syncthing / syncthing-android

Wrapper of syncthing for Android.
https://syncthing.net/
Mozilla Public License 2.0
3.16k stars 362 forks source link

"Run on specified Wi-Fi networks" gives specious error on app opening #2068

Closed jbusnengo closed 3 months ago

jbusnengo commented 3 months ago

I use the run on specified wi-fi networks setting. Every time I open the app, regardless of what wi-fi network I'm connected to, I get the following error:

Screenshot_20240311-092852

Assuming I'm on a whitelisted wi-fi network, I can make the error go away by tapping "Change Settings" then going back twice (without changing any settings). Sometimes it requires me to do this twice.

While this is obviously not an app-breaking bug, it's certainly quite annoying. Please let me know if I can provide any additional information for debugging.

Version Information

App Version: 1.27.3
Syncthing Version: v1.27.3
Android Version: Android 14 (Google Pixel 6)

Screenshot_20240311-093614

AudriusButkevicius commented 3 months ago

I think this is due to lacking permissions. Wifi network names are considered location information, so syncthing needs location permissions to be able to read wifi network names.

tomasz1986 commented 3 months ago

And make sure to allow location access "all the time", not only "while in use".

jbusnengo commented 3 months ago

I had already allowed location access, but only "while in use". I've changed to "all the time" and will see if that eliminates the problem.

If it does, maybe it might be worth either adding a different error message when the problem is denial of access or adding text to the setting warning that it requires location access "all the time" instead of "while in use".

jbusnengo commented 3 months ago

To elaborate on my prior message, while I know that the error raises the possibility of restricted location permissions, I immediately assumed that couldn't be the issue because I knew I'd granted location permissions.

tomasz1986 commented 3 months ago

Yeah, so the solution is basically described in https://github.com/syncthing/syncthing-android/issues/1960#issuecomment-1752087962. The app should require and ask to access location "all the time", as it is necessary when using these features, but currently it only asks to use location when active (i.e. open with screen turned on). In your case, this leads to the app being unable to detect the current network, and thus it stops Syncthing from running.

Closing as duplicate of #1960.