Closed tomasz1986 closed 2 years ago
This definitely works in general. I've just tested it with the Syncthing instance on my server and I've got a gray icon and disconnect notifications immediately. It works when stopping NGINX used as reverse proxy and it also works when stopping Syncthing itself.
Maybe it behaves differently under Windows.
Apparently I was partially wrong. I should have done more testing. I am sorry for that.
The icon does properly update after shutting Syncthing down. However, it does not if the device itself got disconnected from the network. The device is properly listed as "disconnected" in the Syncthing's GUI, but Syncthing Tray still seems to behave as if it was present.
One of the devices in question is running Android, just for reference. The other is running Windows. Syncthing Tray itself is running on another Windows computer. The problem happens both with the Android and the Windows device. If I disconnect them from the network (e.g. by turning their WiFi off), Syncthing Tray still marks the icon as "idle" and stays like that no matter what.
This was never supposed to work that way. "Disconnected" in the sense of Syncthing Trays simply means "disconnected from Syncthing's REST/event API".
One of the devices [...] is running Android, [...] The other is running Windows. Syncthing Tray itself is running on another Windows computer. If I disconnect them from the network (e.g. by turning their WiFi off), Syncthing Tray still marks the icon as "idle" and stays like that no matter what.
Wait, your still talking about the overall status icon right? So the overall status icon should turn info the greyish "offline" as soon as at least one remote device is offline? Or if no remote devices are connected at all? Both makes not much sense to me. Isn't it quite normal that not all devices within the cluster are permanently online?
Or are you talking about the status within the "Devices" tab? Then I can not reproduce the problem.
No no, I am talking about the icon changing to grey when the Syncthing URL specified in the configuration is unavailable. As far as I understand, if this address is unavailable, the REST/event API is also inaccessible, is it not?
I am talking about this setting, i.e. nothing about the "Devices" tab, etc. I am sorry for any confusion.
To put it simply,
10.0.0.2
) and is configured to connect to Syncthing running on Device B (10.0.0.6
). The URL in the configuration is set to https://10.0.0.6:8384
.and there are two cases,
but then
https://10.0.0.6:8384
is not accessible anymore. This is not expected.The only difference between 2. and 3., which I can think of, is that in the former the IP address itself (10.0.0.6
) remains always pingable, while in the latter the IP address is unavailable.
After more testing, this is how to reproduce:
https://10.0.0.6:8384
.The remote URL is pingable and Syncthing Tray connects with it properly.
>ping 10.0.0.6
Pinging 10.0.0.6 with 32 bytes of data:
Reply from 10.0.0.6: bytes=32 time=6ms TTL=64
Reply from 10.0.0.6: bytes=32 time=2ms TTL=64
Reply from 10.0.0.6: bytes=32 time=14ms TTL=64
Reply from 10.0.0.6: bytes=32 time=19ms TTL=64
Ping statistics for 10.0.0.6:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 19ms, Average = 10ms
Disconnect the remote device from the network.
>ping 10.0.0.6
Pinging 10.0.0.6 with 32 bytes of data:
Reply from 10.0.0.2: Destination host unreachable.
Reply from 10.0.0.2: Destination host unreachable.
Reply from 10.0.0.2: Destination host unreachable.
Reply from 10.0.0.2: Destination host unreachable.
Ping statistics for 10.0.0.6:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Ah, ok. I suppose in case 3. the timeout for the TCP connection is waited. I don't do anything special regarding timeout handling within my code so I guess the default timeout applies (possibly even set on OS level).
Do you have any idea of a possible workaround (either in Syncthing Tray, or at the user side)? Right now, there seems to be no timeout at all, as the icon stays like this forever, and I have not messed around with the default TCP connection related settings in Windows either.
Edit: It seems that after 2 hours or so the icon finally changed to grey, so there must be some kind of a timeout in place, but apparently awfully long.
I don't know any workaround, especially not under Windows. Feel free to play around with it yourself. I am not aware that Qt would provide a way to set a timeout but one could likely simply use a timer to implement an early abort of the connection.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Relevant components
syncthingctl
)libsyncthing
)Environment and versions Syncthing Tray v1.0.1 (development build) Windows 10 Enterprise 2019 LTSC
Bug description I have Syncthing Tray configured on a Windows PC to connect to Syncthing on the local computer, and also on a few remote devices, which use local LAN addresses. It seems that the program is unable to detect connection changes on the remote devices. Basically, if I disconnect or shut Syncthing down on a remote device, Syncthing Tray still shows it as connected, and vice versa.
This is not the case on the local computer, where Syncthing Tray is running. As soon as Syncthing has been shut down or started, an icon update follows. The issue only happens with the remote devices. Am I doing something wrong or is this some kind of a bug or limitation?
My configuration is as follows.
Local machine (with Syncthing Tray, connection changes detected correctly)
Remote machine (on the same LAN, unable to detect connection changes)
Steps to reproduce
Expected behavior Syncthing tray should detect whether Syncthing is still running, or has been started on remote devices, and then update its status accordingly.
Screenshots
Additional context