Skip to content

daemon: Skip UI service activation when already running - #239

Merged
iinuwa merged 1 commit into
linux-credentials:mainfrom
LucFauvel:fix/ui-start-service-when-running
Sep 27, 2026
Merged

iinuwa merged 1 commit into
linux-credentials:mainfrom
LucFauvel:fix/ui-start-service-when-running

Conversation

@LucFauvel

Copy link
Copy Markdown
Contributor

dbus-broker rejects StartServiceByName for names without an activation file, even if the name is already owned. This broke running credentialsd-ui manually during development, since the daemon failed every request with "The name is not activatable".

Only request activation if the UI Control name has no owner yet.

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this!

After addressing the comments, could you add a note to the changelog and change the fix: in your commit message to daemon:?

Comment thread credentialsd/src/dbus/ui_control.rs Outdated
// (e.g. dbus-broker) reject `StartServiceByName` for names without an activation
// file, even if the name is owned, which breaks running the UI manually.
let destination = backend_proxy.as_ref().destination().clone();
if !dbus_proxy.name_has_owner(destination.clone()).await? {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name_has_owner() invokes a D-Bus method, and then we invoke get_name_owner right after activating it. Let's instead do get_name_owner() to get the sender, and then if the error is NameHasNoOwner, then start_by_service_name() to cut down on the extra call. This way we only do 1 or 2 calls (which is more efficient than what we have now, so that's an improvement).

@LucFauvel LucFauvel changed the title fix: Skip UI service activation when already running daemon: Skip UI service activation when already running Sep 25, 2026
Bus implementations reject StartServiceByName for names without an
activation file, even if the name is already owned. This broke running
credentialsd-ui manually during development, since the daemon failed
every request with "The name is not activatable".

Look up the owner of the UI Control name first, and only request
activation if it has no owner yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@LucFauvel
LucFauvel force-pushed the fix/ui-start-service-when-running branch from ad1f4ed to adcd571 Compare September 27, 2026 14:01

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@iinuwa
iinuwa merged commit 9bd8f4e into linux-credentials:main Sep 27, 2026
1 check passed
@LucFauvel
LucFauvel deleted the fix/ui-start-service-when-running branch September 27, 2026 19:14
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