syncthing-android
syncthing-android copied to clipboard
In comma-separated list of addresses, commas become part of the addresses
I added two addresses to a device. However, the other device is the one that usually finds the phone and not vice versa. It seems that the app has a problem with commas in the list of devices because everything works like expected when I add only one address.
Steps to reproduce
- Go to the Devices tab and tap "+" to Add Device
- Add a Device ID (like the example ID in the Syncthing docs). Then add a name, like TestDevice.
- In the addreses, add two values separated by comma and space. I'll use
tcp://192.168.0.0, dynamic
for this example. - Add device to finish.
- Go to Menu -> Web GUI, scroll to the Remote Devices section, and click on TestDevice. There should be two values in the Address row in separate lines.
Expected results
The two values in the Addresses row should be tcp://192.168.0.0
and dynamic
Actual results
The first value is tcp://192.168.0.0,
. There shouldn't be a comma at the end.
While on the Web GUI, tap Edit under TestDevice, then go to the Advanced tab, the Addresses box says tcp://192.168.0.0,, dynamic
.
If I now Save to close the Edit Device (TestDevice) window without making any changes, and check the Addresses row again, the first address is shown without the comma. It seems that the Syncthing GUI fixed the address.
After this, I exit the Web GUI and click on TestDevice on the Devices tab on the app, and the value of the addresses is now tcp://192.168.0.0 dynamic
.
This is what works. In the app I need to separate addresses using only spaces for the values to be stored correctly.
Possible cause
The TextWatcher for the address box calls the two following methods:
https://github.com/syncthing/syncthing-android/blob/7904afd1ff43240ba69b8289719df5e01bde3ed3/app/src/main/java/com/nutomic/syncthingandroid/activities/DeviceActivity.java#L406-L417
This looks to me that the app is processing addresses using spaces as delimiters, instead of commas like Syncthing does.
Version Information
App Version: 1.27.5
Syncthing Version: v1.27.5
Android Version: Android 11