Skip to content

sync: from linuxdeepin/dde-session-shell - #531

Merged
52cyb merged 1 commit into
masterfrom
sync-pr-83-nosync
Sep 1, 2026
Merged

sync: from linuxdeepin/dde-session-shell#531
52cyb merged 1 commit into
masterfrom
sync-pr-83-nosync

Conversation

@deepin-ci-robot

@deepin-ci-robot deepin-ci-robot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#83

Summary by Sourcery

Stabilize lock-screen authentication during system wake-up by coalescing closely timed resume signals.

Bug Fixes:

  • Prevent duplicate or premature lock-screen authentication requests when the system resumes from standby.

Enhancements:

  • Coordinate wake-up authentication signals with a short delay and cancel pending authentication when the lock screen becomes inactive or the system enters sleep.

Chores:

  • Synchronize source changes from dde-session-shell and update copyright years.

@sourcery-ai

sourcery-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduces a 300 ms single-shot wake-up authentication timer so back-to-back ActiveChanged and PrepareForSleep signals result in only one authentication creation, while cancelling pending work during sleep or deactivation.

Sequence diagram for deduplicated wake-up authentication

sequenceDiagram
    participant ActiveChanged
    participant PrepareForSleep
    participant LockWorker
    participant WakeUpAuthTimer
    participant Authentication

    ActiveChanged->>LockWorker: activeChanged()
    LockWorker->>WakeUpAuthTimer: start()
    PrepareForSleep->>LockWorker: prepareForSleepChanged()
    LockWorker->>WakeUpAuthTimer: start()
    WakeUpAuthTimer-->>LockWorker: timeout()
    LockWorker->>Authentication: createAuthentication(name())

    alt system enters sleep or lock deactivates
        LockWorker->>WakeUpAuthTimer: stop()
        LockWorker->>Authentication: endAuthentication(m_account, AT_All)
        LockWorker->>Authentication: destroyAuthentication(m_account)
    end
Loading

File-Level Changes

Change Details Files
Debounce authentication creation during wake-up and session activation transitions.
  • Add a single-shot 300 ms timer to defer authentication creation.
  • Start the timer instead of creating authentication immediately when the session becomes active or resumes.
  • Stop the timer during sleep, deactivation, and visibility changes to prevent stale authentication setup.
  • Update SPDX copyright years.
src/dde-lock/lockworker.cpp
src/dde-lock/lockworker.h

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/dde-lock/lockworker.cpp" line_range="160" />
<code_context>

         if (active && m_model->visible()) {
-            createAuthentication(m_model->currentUser()->name());
+            m_wakeUpAuthTimer->start();
         } else {
+            m_wakeUpAuthTimer->stop();
</code_context>
<issue_to_address>
**issue (bug_risk):** The timer remains armed when `visibleChanged(false)` hides the lock screen, because that handler does not stop `m_wakeUpAuthTimer`. If the screen becomes hidden during the 300 ms delay, the timeout still calls `createAuthentication()` and recreates authentication for an invisible lock screen.

**Triggers:** When `ActiveChanged(true)` starts the timer and the model becomes invisible before the 300 ms timeout.

**Suggested fix:** Stop `m_wakeUpAuthTimer` in the model's `visibleChanged(false)` path and recheck visibility before creating authentication.
</issue_to_address>

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.

Comment thread src/dde-lock/lockworker.cpp
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#83
@deepin-ci-robot

Copy link
Copy Markdown
Contributor Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 52cyb, deepin-ci-robot

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

@52cyb
52cyb merged commit 8dbfef8 into master Sep 1, 2026
24 of 26 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.

2 participants