Skip to content

Conversation

@m3nu
Copy link
Contributor

@m3nu m3nu commented Dec 21, 2025

Commit 68e0452 introduced a bug in get_result() that caused all KWallet password lookups to fail. The method was changed to return KWalletResult enums, but the implementation had two critical flaws:

  1. KWalletResult.from_variant(result.arguments()) passed the entire arguments list instead of result.arguments()[0]. Since KWalletResult can only be constructed from integers 0, 1, or 2, passing a list always raised ValueError and returned KWalletResult.INVALID.

  2. The abstraction was fundamentally wrong - DBus methods return different types (bool for isEnabled/hasEntry, str for readPassword/networkWallet, int for open), but everything was being converted to a 3-value enum.

This caused:

  • get_password() to always return None (hasEntry check always failed)
  • try_unlock() to always prompt for a new wallet name
  • Wallet handles to be lost (output.value gave enum value, not actual handle)

Fix: Restore get_result() to return raw DBus values (arguments[0]) while keeping the improved error handling. Update all call sites to check for None/truthy values instead of enum comparisons.

Fixes #2327

m3nu and others added 3 commits December 21, 2025 15:13
…rn type

Commit 68e0452 introduced a bug in `get_result()` that caused all KWallet
password lookups to fail. The method was changed to return `KWalletResult`
enums, but the implementation had two critical flaws:

1. `KWalletResult.from_variant(result.arguments())` passed the entire
   arguments list instead of `result.arguments()[0]`. Since `KWalletResult`
   can only be constructed from integers 0, 1, or 2, passing a list always
   raised ValueError and returned `KWalletResult.INVALID`.

2. The abstraction was fundamentally wrong - DBus methods return different
   types (bool for `isEnabled`/`hasEntry`, str for `readPassword`/`networkWallet`,
   int for `open`), but everything was being converted to a 3-value enum.

This caused:
- `get_password()` to always return None (hasEntry check always failed)
- `try_unlock()` to always prompt for a new wallet name
- Wallet handles to be lost (output.value gave enum value, not actual handle)

Fix: Restore `get_result()` to return raw DBus values (`arguments[0]`)
while keeping the improved error handling. Update all call sites to check
for `None`/truthy values instead of enum comparisons.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@m3nu m3nu merged commit 642d759 into master Dec 23, 2025
4 of 5 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.

Vorta cannot get password from KWallet anymore - regression between 0.10.3 and 0.11.1

2 participants