Skip to content

fix: resolve keyring prompt issue during login by moving keyring star…#160

Merged
fly602 merged 1 commit intolinuxdeepin:masterfrom
fly602:master
Jul 15, 2025
Merged

fix: resolve keyring prompt issue during login by moving keyring star…#160
fly602 merged 1 commit intolinuxdeepin:masterfrom
fly602:master

Conversation

@fly602
Copy link
Copy Markdown
Contributor

@fly602 fly602 commented Jul 15, 2025

…tup to Xsession.d

Previously, dde-update could block the startup of dde-session during update checks, causing deepin-keyring-whitebox to timeout while waiting for the client to unlock the keyring. This commit moves the startup of deepin-keyring-whitebox and gnome-keyring-daemon to an Xsession.d script, ensuring the keyring is initialized independently and preventing login keyring prompt timeouts.

log:
pms: BUG-323511

Summary by Sourcery

Move keyring initialization out of dde-session code into an Xsession.d script to prevent login hangs and timeouts

Bug Fixes:

  • Fix login keyring prompt hanging due to dde-update blocking dde-session startup

Enhancements:

  • Shift deepin-keyring-whitebox and gnome-keyring-daemon startup to a new Xsession.d script
  • Remove inline keyring daemon initialization from EnvironmentsManager and main

Build:

  • Include the new 97deepin-keyring-wb script in CMakeLists for Xsession.d installation

…tup to Xsession.d

Previously, dde-update could block the startup of dde-session during update checks, causing deepin-keyring-whitebox to timeout while waiting for the client to unlock the keyring. This commit moves the startup of deepin-keyring-whitebox and gnome-keyring-daemon to an Xsession.d script, ensuring the keyring is initialized independently and preventing login keyring prompt timeouts.

log:
pms: BUG-323511
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 15, 2025

Reviewer's Guide

Relocates keyring daemon startup from in-process environment manager and session code into a standalone Xsession.d script, preventing blocking during login and avoiding keyring timeout issues.

Sequence diagram for keyring initialization during login (after PR)

sequenceDiagram
    actor User
    participant XsessionD as Xsession.d
    participant KeyringWB as deepin-keyring-whitebox
    participant GnomeKeyring as gnome-keyring-daemon
    participant DDESession as dde-session

    User->>XsessionD: Start login session
    XsessionD->>KeyringWB: Start deepin-keyring-whitebox
    XsessionD->>GnomeKeyring: Start gnome-keyring-daemon
    XsessionD->>DDESession: Start dde-session
Loading

Class diagram for EnvironmentsManager after keyring logic removal

classDiagram
    class EnvironmentsManager {
        +EnvironmentsManager()
        -void createGeneralEnvironments()
        -void createDBusEnvironments()
        -bool unsetEnv(QString env)
        -QMap<QString, QString> m_envMap
    }
Loading

File-Level Changes

Change Details Files
Extract keyring initialization out of application code into Xsession.d
  • Removed createKeyringEnvironments() and its invocation from the environments manager
  • Deleted direct startup call for deepin-keyring-whitebox in main.cpp
  • Updated CMakeLists to install the new Xsession.d script
  • Added 97deepin-keyring-wb script to launch keyring daemons at session start
src/dde-session/environmentsmanager.cpp
src/dde-session/environmentsmanager.h
src/dde-session/main.cpp
misc/CMakeLists.txt
misc/Xsession.d/97deepin-keyring-wb

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

关键摘要:

  • CMakeLists.txt中新增了一个脚本路径,需要确认该路径是否正确且脚本文件存在。
  • 新增的脚本97deepin-keyring-wb中使用了|| true来忽略错误,这可能会导致错误被静默处理,建议添加错误日志以便追踪。
  • EnvironmentsManager类中的createKeyringEnvironments函数被移除,但相关的环境变量设置逻辑可能需要在新脚本97deepin-keyring-wb中实现。
  • main.cpp中移除了deepin-keyring-whitebox的启动代码,如果这是有意为之,需要确认是否有替代方案来启动该服务。

是否建议立即修改:

  • 确认新增脚本路径的正确性和文件存在性。
  • 添加错误日志到97deepin-keyring-wb脚本中,以便于问题追踪。
  • 如果createKeyringEnvironments函数被移除,需要在新脚本中实现相应的环境变量设置逻辑。
  • 如果移除deepin-keyring-whitebox的启动代码是有意为之,需要确保有其他机制来启动该服务,或者提供替代方案。

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @fly602 - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, yixinshark

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fly602 fly602 merged commit f3c69f5 into linuxdeepin:master Jul 15, 2025
16 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.

3 participants