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

Better handle disconnects, e.g. after changing theme #257

Open
1 of 6 tasks
mojo-jojo-7 opened this issue Apr 28, 2024 · 6 comments
Open
1 of 6 tasks

Better handle disconnects, e.g. after changing theme #257

mojo-jojo-7 opened this issue Apr 28, 2024 · 6 comments

Comments

@mojo-jojo-7
Copy link

mojo-jojo-7 commented Apr 28, 2024

Relevant components

  • Standalone tray application (based on Qt Widgets)
  • Plasmoid/applet for Plasma desktop
  • Dolphin integration
  • Command line tool (syncthingctl)
  • Integrated Syncthing instance (libsyncthing)
  • Backend libraries

Environment and versions

  • Versions of syncthingtray, qtutilities and c++utilities: 1.5.2, ?, ?
  • Qt version: 6.6.3
  • C++ compiler (name and version): ?
  • C++ standard library (name and version): ?
  • Operating system (name and version): Windows 10 Pro 22H2

Bug description
The tray app disconnects from Syncthing when I change the theme and click on "Save" using the Web GUI. And although it connects back automatically after some time, this seems weird.

Steps to reproduce

  1. Make sure Syncthing Tray is connected and running
  2. Open the Web GUI > Actions > Settings > GUI > Change theme > Save
  3. Notice the tray app disconnecting with the error: "Unable to request disk events. Connection closed" or "Unable to request device statistics. Connection closed"

Expected behavior
No disconnection should happen

@Martchus
Copy link
Owner

Probably Syncthing itself really just restarted its listener. In this case it is natural for Syncthing Tray to consider this a disconnect. Since Syncthing Tray cannot know the reason for the disconnect it cannot really filter this kind of error out. Not sure what I can improve here from my side.

@Martchus Martchus removed the bug label Apr 28, 2024
@Martchus Martchus changed the title [Bug] Error: Unable to request disk events. Connection closed Disconnect after changing theme Apr 28, 2024
@Martchus
Copy link
Owner

Martchus commented Apr 28, 2024

I could add a feature to suppress errors if it is possible to reconnect within a certain timeframe (but not sure whether it's worth it).

@Martchus Martchus changed the title Disconnect after changing theme Better handle disconnects, e.g. after changing theme Apr 28, 2024
@mojo-jojo-7
Copy link
Author

Thanks for the quick response @Martchus. I flagged because I wasn't sure what was happening, but if it is what you suspect it is, then that indeed doesn't sound worth it. Feel free to close the issue!

@Martchus
Copy link
Owner

I was actually able to reproduce the problem yesterday - also under Windows 10. I noticed some additional particularities that were a bit strange:

  1. The disconnect was not immediate (but happened and the error was "Connection closed"). Probably the connection was not terminated immediately by Syncthing and only closed after the long-polling timeout was exceeded. This will probably not affect the feature idea mentioned in Better handle disconnects, e.g. after changing theme #257 (comment).
  2. The configured re-connect interval was not effective; no re-connect happened. Triggering a re-connect manually by clicking the button in the settings worked immediately, though. Maybe I was finally able to reproduce Syncthing Tray sometimes loses connection to Syncthing and fails to connect again on its own #217.

I've just tested under GNU/Linux as well. There the behavior is different and actually more like I would expect it:

  1. The disconnect was immediate (with error "Connection refused").
  2. The re-connect interval was effective.

Copy link

stale bot commented Jun 29, 2024

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.

@stale stale bot added the stale label Jun 29, 2024
@Martchus
Copy link
Owner

Basically the same as #236.

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

No branches or pull requests

2 participants