Skip to content

Fixing pairing issues on KDE - #15

Merged
zoir-dev merged 2 commits into
zoir-dev:mainfrom
X-Ryl669:fix/doesnt-pair
Aug 28, 2026
Merged

Fixing pairing issues on KDE#15
zoir-dev merged 2 commits into
zoir-dev:mainfrom
X-Ryl669:fix/doesnt-pair

Conversation

@X-Ryl669

Copy link
Copy Markdown
Contributor

On another laptop running KDE, I had both gnome's keyring and KDE keyring installed, with my KDE keyring being the default (and locked). Vortex will display its scan page, but couldn't find the phone.

While debugging, it appeared that Vortex is expected the keyring to be unlocked to write to it directly. This PR patches this invalid assumption, if the keyring is locked, unlock it (likely asking User's password for that), and upon success, write to it.

Another (cosmetic) issue was the "removeBond" toast that appeared continuously. Let's log it, but don't toast it on the Android screen.

These commits are authored by Claude.

claude added 2 commits August 25, 2026 15:55
The DEBUG-only `--es remove_bond <MAC>` hook popped a LONG toast over the
pairing UI on every launch — precisely when it is in the way, since the
hook exists to clear stale one-sided LE bonds while live-debugging that
same pairing flow.

Nothing is lost: BondCleaner already logs the outcome
("VortexBondCleaner: removeBond(<mac>) -> <ok>"), and the `ok` binding
existed only to feed the toast.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…losed

`get_default_collection()` succeeds on a *locked* collection — only the
write that follows fails, with `org.freedesktop.Secret.Error.IsLocked`.
So each store's availability probe in `new()` passed and the process died
later, at first save, with an error nobody attributed to the keyring.

That is the normal state on any session whose `default` alias points at a
keyring PAM does not unlock at login. Live-hit on Manjaro/KDE: gnome-keyring
owned `org.freedesktop.secrets` (its D-Bus service file wins over KDE's
ksecretd), its `login` keyring was unlocked, but `default` pointed at a
second, password-protected keyring. Identity init failed, the Tauri worker
returned before it ever opened the BLE adapter, and the pairing radar sat
silently empty — the phone was advertising correctly the whole time. The
same app paired fine on a GNOME laptop, where `default` resolves unlocked.

`unlocked_default_collection()` now calls `Collection::unlock()`, which
drives the Secret Service Unlock + Prompt handshake so the desktop's own
prompter asks for the password — gcr on GNOME, ksecretd/KWallet on KDE, no
per-desktop branching and nothing for the user to configure by hand.

Two constraints from the D-Bus API, both satisfied by construction and
recorded at the helper:

  * the prompt object is owned by the *calling connection* and dies with
    it, so the unlock must share one connection with the write it enables
    — i.e. live inside the same `secret_block_on` future;
  * once unlocked it costs one round trip, not a prompt (the service
    returns the path in `unlocked` and `lock_or_unlock` skips the prompt),
    so it is safe to call before every write rather than tracking unlock
    state ourselves.

Applied at all five write sites (identity save + the four peer-store
mutations); reads already unlocked individual items. Adds
`StorageError::Locked` so a dismissed prompt — the one storage failure a
user can actually fix — is distinguishable from a generic backend error
by callers that want to surface it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@zoir-dev
zoir-dev merged commit 49f424b into zoir-dev:main Aug 28, 2026
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.

3 participants