Skip to content

v2026.3.10#12

Merged
nlogozzo merged 6 commits intomainfrom
copilot/fix-unhandled-exception-lock
Mar 24, 2026
Merged

v2026.3.10#12
nlogozzo merged 6 commits intomainfrom
copilot/fix-unhandled-exception-lock

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

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]

@nlogozzo
Copy link
Copy Markdown
Member

@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...

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 24, 2026

@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:

  1. Subscribes to the org.freedesktop.Secret.Prompt.Completed signal on the prompt object
  2. Calls Prompt("") to show the unlock dialog to the user
  3. 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.

Copilot AI requested a review from nlogozzo March 24, 2026 03:56
@nlogozzo nlogozzo changed the title Fix unhandled DBusException when Linux keyring item is locked Fix unhandled DBusException and match libsecret implementation Mar 24, 2026
@nlogozzo nlogozzo changed the title Fix unhandled DBusException and match libsecret implementation v2026.3.10 Mar 24, 2026
@nlogozzo nlogozzo marked this pull request as ready for review March 24, 2026 15:33
@nlogozzo nlogozzo merged commit 17215d8 into main Mar 24, 2026
11 checks passed
@nlogozzo nlogozzo deleted the copilot/fix-unhandled-exception-lock branch March 24, 2026 15:34
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.

2 participants