You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request refactors the interaction with the FreeDesktop Secret Service to improve reliability and user experience, especially when handling locked items and user prompts. The changes simplify secret management by searching for items across all collections, handling locked items more gracefully, and prompting the user only when required. Error handling and logging are also improved for better diagnostics.
Secret Service Proxy improvements:
The UnlockAsync method now returns a bool to indicate if the unlock was successful or dismissed by the user, and a new PromptAsync helper method was added to handle user prompts via D-Bus signals. [1][2]
The SearchItemsAsync method now searches across all collections, returning separate arrays for unlocked and locked items, and improves error handling for locked items. [1][2][3][4]
Secret management workflow updates:
The DeleteAsync, GetAsync, and UpdateAsync methods in SecretService.cs have been updated to use the new search and unlock logic, ensuring the correct item is targeted and prompting the user only when necessary. Logging and error handling are improved for cases where secrets are not found or unlocks are dismissed. [1][2][3]
@copilot Can we make sure the user gets prompted to unlock instead of returning null? Will this unlock flow work on flatpak as well? Where the secrets should get unlocked by the portal...
@copilot Can we make sure the user gets prompted to unlock instead of returning null? Will this unlock flow work on flatpak as well? Where the secrets should get unlocked by the portal...
Done in commit 570e0f3. UnlockAsync now reads the prompt path returned by the D-Bus Unlock call and, when a prompt is needed (path ≠ "/"), invokes the new PromptAsync helper which:
Subscribes to the org.freedesktop.Secret.Prompt.Completed signal on the prompt object
Calls Prompt("") to show the unlock dialog to the user
Awaits the Completed signal — returning true if the user confirmed, false if they dismissed
This is the standard org.freedesktop.Secret.Prompt D-Bus interface, which is implemented by both the native libsecret daemon and the xdg-desktop-portal secrets portal, so it works correctly on Flatpak as well.
nlogozzo
changed the title
Fix unhandled DBusException when Linux keyring item is locked
Fix unhandled DBusException and match libsecret implementation
Mar 24, 2026
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
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.
This pull request refactors the interaction with the FreeDesktop Secret Service to improve reliability and user experience, especially when handling locked items and user prompts. The changes simplify secret management by searching for items across all collections, handling locked items more gracefully, and prompting the user only when required. Error handling and logging are also improved for better diagnostics.
Secret Service Proxy improvements:
UnlockAsyncmethod now returns aboolto indicate if the unlock was successful or dismissed by the user, and a newPromptAsynchelper method was added to handle user prompts via D-Bus signals. [1] [2]SearchItemsAsyncmethod now searches across all collections, returning separate arrays for unlocked and locked items, and improves error handling for locked items. [1] [2] [3] [4]Secret management workflow updates:
DeleteAsync,GetAsync, andUpdateAsyncmethods inSecretService.cshave been updated to use the new search and unlock logic, ensuring the correct item is targeted and prompting the user only when necessary. Logging and error handling are improved for cases where secrets are not found or unlocks are dismissed. [1] [2] [3]