Skip to content
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

Syncthingtray not connecting to Syncthing after suspend #16

Closed
Nutomic opened this issue Apr 22, 2018 · 10 comments
Closed

Syncthingtray not connecting to Syncthing after suspend #16

Nutomic opened this issue Apr 22, 2018 · 10 comments
Labels

Comments

@Nutomic
Copy link

Nutomic commented Apr 22, 2018

I am running syncthingtray on my laptop with Manjaro KDE. Syncthing is started via Autostart in the system settings (not systemd). Now whenever I wake my laptop from suspend, syncthingtray does not connect to it at all, i have to manually click the connect button. It would be great if this could work automatically, eg by having syncthingtray try to connect every 10 seconds (or some other interval).

Syncthing Tray, version 0.7.4
Syncthing v0.14.46

@Martchus
Copy link
Owner

Martchus commented Apr 22, 2018

I did some refactoring regarding that code anyways (because it already looked a bit faulty). So maybe this is already fixed on latest master? I haven't tested this myself but I will before releasing 0.7.5. There are PKGBUILDs for the Git version if you like to test.

Note that a delayed reconnect after suspension is expected because the tray needs to give Syncthing some time to become available again. I guess this delay is 5 or 10 seconds. Since the disconnect happened due to suspension, the 'disconnected' notification is suppressed. If the delayed reconnect fails you should receive the usual 'can not connect' notification. Configuring a re-connect interval is already possible. So if you configured a reconnect interval, it should now try to re-establish the connection periodically. Seems like this didn't work in your case?

BTW: If the tray can not detect suspension (1) there's no delay and the reconnect interval is used directly. In this case the 'disconnected' notification can not be suppressed and should show up after suspension if enabled in the settings.
(1) Detecting suspension only works for systemd and when you're user session D-Bus daemon is configured correctly to play well with systemd. If busctl --user works, then the tray should work as well.

@Martchus Martchus added the bug label Apr 22, 2018
@Nutomic
Copy link
Author

Nutomic commented Apr 22, 2018

Ah you are right, I missed the reconnect setting, will give that a try. Maybe you could enable that by default?

@Martchus
Copy link
Owner

And, does it work?

The reconnect would be annoying if one actually want the service not to run always. Since the launcher and systemd unit status can now be considered to prevent connection attempts when Syncthing isn't running anyways this problem present anymore. So yes, I could make it default. Maybe 30 seconds or so.

@Nutomic
Copy link
Author

Nutomic commented Apr 24, 2018

Yes its working fine now with the reconnect.

@Martchus
Copy link
Owner

Martchus commented May 1, 2018

Good. I also set the auto-reconnect default to 30 seconds.

@Martchus Martchus closed this as completed May 1, 2018
@stefs
Copy link

stefs commented Oct 3, 2021

I also set the auto-reconnect default to 30 seconds.

Hello, it seems that the auto-reconnect default is disabled again, and not 30 seconds:

static constexpr int defaultReconnectInterval = 0;

@Martchus
Copy link
Owner

Martchus commented Oct 3, 2021

Seems like it got lost when refactoring. I could change it back to 30 seconds if that's wanted.

@stefs
Copy link

stefs commented Oct 3, 2021

I installed syncthingtray 1.1.10-1 from AUR on 5.10.68-1-MANJARO x86_64. I configured it with "Start the tray icon when the desktop environment launches" and "Launch Syncthing when starting the tray icon".
With this configuration out of the box syncthing did start as expected, but the UI did never connect automatically after startup. I had to click connect manually after every boot.
With the Reconnect set to 30 secs it connects after startup. However I don't know if my experience can be generalized for all setups.

@Martchus
Copy link
Owner

Martchus commented Oct 3, 2021

See the second paragraph of https://github.com/Martchus/syncthingtray#configuring-the-built-in-launcher. It also counts for the systemd integration.

I guess I'll better enable the reconnect interval again by default.

@stefs
Copy link

stefs commented Oct 4, 2021

I tested with the "Consider process status …" checkbox, and disabled the Reconnect. This is working as well.
So either the "Consider process status …" or the Reconnect would be useful to be enabled by default for my configuration anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants