Skip to content

sync: say what is actually missing, in the local spelling - #99

Merged
davidboulay merged 1 commit into
mainfrom
fix/sync-dependency-hint
Sep 19, 2026
Merged

davidboulay merged 1 commit into
mainfrom
fix/sync-dependency-hint

Conversation

@davidboulay

Copy link
Copy Markdown
Owner

The settings hint was the fixed string "Install python3-nacl and python3-zeroconf to enable sync." It is wrong twice.

It names two modules. sync_available() is _HAVE_NACL and _HAVE_ZC and _HAVE_SPAKE2 — three. A user who installs exactly what the hint asks for comes back to the same unchanged message, with nothing anywhere telling them spake2 is also wanted. There is no way out of that loop from inside the app.

It names Debian packages on every distro. Reported from an Arch/Omarchy install, where the two packages named do not exist under those names at all.

Both halves were avoidable: the import guards already record which module failed, and the package names already exist in scripts/install.sh and the packaging depends lists. The hint consulted none of it.

The fix

missing_modules() reports which imports really failed, and missing_packages_hint() maps those to package names for the package manager actually present, in install.sh's own detection order:

manager nacl zeroconf spake2
pacman python-pynacl python-zeroconf python-spake2
apt python3-nacl python3-zeroconf python3-spake2
dnf python3-pynacl python3-zeroconf python3-spake2

nacl is the one that differs between apt and dnf, so a single shared table would have quietly sent Fedora users after a package that is not there.

Two routes get their own answer. An unrecognised package manager still names the modules, which is more use than naming packages that may not exist. A Flatpak says the build is missing them rather than asking the user to install into a sandbox they cannot reach — there, it is our bug, not their setup.

A second instance of the same bug

scripts/install.sh had the same omission independently: its apt and dnf branches installed nacl and zeroconf but not spake2, so a source install on Debian or Fedora left sync permanently unavailable with no error and no hint that anything was missing. Only the pacman branch was complete.

Fixed here, and sync_hint_test.py now derives its expectations from _SYNC_PACKAGES so the script and the hint cannot drift apart again — which is exactly how they came to disagree.

🤖 Generated with Claude Code

The settings hint was the fixed string "Install python3-nacl and python3-zeroconf
to enable sync." It is wrong twice.

It names two modules. sync_available() is `_HAVE_NACL and _HAVE_ZC and
_HAVE_SPAKE2` -- three. A user who installs exactly what the hint asks for comes
back to the same unchanged message, with nothing anywhere telling them spake2 is
also wanted. There is no way out of that loop from inside the app.

It names Debian packages on every distro. Reported from an Arch/Omarchy install,
where the two packages named do not exist under those names at all.

Both halves were avoidable: the import guards already record which module failed,
and the package names already exist in scripts/install.sh and the packaging
depends lists. The hint consulted none of it.

So derive it. missing_modules() reports which imports really failed, and
missing_packages_hint() maps those to package names for the package manager
actually present, in install.sh's own detection order:

  pacman   python-pynacl  python-zeroconf   python-spake2
  apt      python3-nacl   python3-zeroconf  python3-spake2
  dnf      python3-pynacl python3-zeroconf  python3-spake2

nacl is the one that differs between apt and dnf, so a single shared table would
have quietly sent Fedora users after a package that is not there.

Two routes get their own answer. An unrecognised package manager still names the
modules, which is more use than naming packages that may not exist. A Flatpak
says the build is missing them rather than asking the user to install into a
sandbox they cannot reach -- there, it is our bug, not their setup.

scripts/install.sh had the same omission independently: its apt and dnf branches
installed nacl and zeroconf but not spake2, so a source install on Debian or
Fedora left sync permanently unavailable with no error and no hint that anything
was missing. Only the pacman branch was complete. Fixed here, and
sync_hint_test.py now derives its expectations from _SYNC_PACKAGES so the script
and the hint cannot drift apart again -- which is exactly how they came to
disagree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011QAnwJ7J3jePDGsQsKB47R
@davidboulay
davidboulay merged commit adfc8eb into main Sep 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant