Fixing pairing issues on KDE - #15
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.