Skip to content

external syncthing instances hidden by inactive user unit #45

Description

@ilyaZar

Big thanks at @shawnyeager who reported (essentially) that syncshell does not see existing syncthing instance and the plugin remains unusable

the likely cause is that his instance is managed by a system unit or another launcher rather than the user level syncthing.service

current behavior

syncshell checks only

systemctl --user show syncthing.service

on arch the syncthing package installs both

  • syncthing.service for the user manager
  • syncthing@.service for the system manager

when syncthing@$user.service or another launcher owns the running instance the
packaged user unit can still be loaded but inactive

syncshell treats that inactive unit as proof that syncthing is stopped and
skips api discovery even when the local syncthing api is healthy

the service state reconciliation can also prompt the user to enable an unrelated
user unit

expected behavior

a loaded but inactive user unit must not hide a reachable syncthing instance

when the api is reachable syncshell should work normally regardless of how the
process was started

service controls should only be shown when syncshell knows that the user unit
owns the selected instance

scope

  • stop using the inactive user unit as an api availability check
  • let api availability take precedence over unit state
  • classify a reachable instance with an inactive user unit as externally managed
  • hide the user service toggle and autostart reconciliation in that state
  • keep the existing behavior for instances actually managed by
    syncthing.service
  • add a regression test for an inactive user unit with a reachable external
    instance

reported by shawn after installing 0.1.7 -<> TODO fix this in the next release

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions