Skip to content

chore: add wake-up auth debounce timer comment - #83

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master
Sep 1, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master

Conversation

@52cyb

@52cyb 52cyb commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

In the LockWorker constructor, add a descriptive comment to the wake-up authentication timer setup. The comment explains the purpose of the 300ms single-shot timer: on standby resume, the ActiveChanged and PrepareForSleep signals are emitted back-to-back, so the timer guarantees authentication is created only once regardless of which signal triggers first.

This is a documentation-only change with no functional modifications to the code.

chore: 添加唤醒认证防抖定时器注释

在 LockWorker 构造函数中,为唤醒认证定时器设置添加了描述性注释。注
释说明了 300ms 单次触发定时器的用途:在待机恢复时,ActiveChanged 和
PrepareForSleep 信号会连续发出,因此该定时器确保无论哪个信号先触发,认证
只会创建一次。

这是一次纯文档变更,不涉及代码功能的任何修改。

Influence:

  1. No functional changes; verify normal system wake-up and lock functionality remains unaffected
  2. Confirm no timing or race condition issues introduced during standby resume

PMS: BUG-373405

Summary by Sourcery

Enhancements:

  • Document the wake-up authentication debounce timer’s purpose when handling closely spaced standby-resume signals.

@sourcery-ai

sourcery-ai Bot commented Sep 1, 2026

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

Reviewer's Guide

Adds an explanatory comment to the existing 300 ms wake-up authentication timer setup in LockWorker; no executable logic, timing, or signal-handling behavior is changed.

File-Level Changes

Change Details Files
Document the purpose of the wake-up authentication debounce timer.
  • Explain that standby resume emits ActiveChanged and PrepareForSleep back-to-back.
  • Clarify that the 300 ms single-shot timer prevents duplicate authentication creation regardless of signal order.
src/dde-lock/lockworker.cpp

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="59-61" />
<code_context>

     m_resetSessionTimer->setInterval(15000);

+    // On standby resume, ActiveChanged and PrepareForSleep are reported back to back;
+    // the 300ms single-shot timer guarantees authentication is created only once,
+    // no matter which signal triggers first.
     m_wakeUpAuthTimer->setSingleShot(true);
     m_wakeUpAuthTimer->setInterval(300);
</code_context>
<issue_to_address>
**nitpick:** The comment overstates the debounce guarantee: a single-shot timer coalesces starts only when ActiveChanged and PrepareForSleep arrive within the 300ms interval; if the second signal arrives after the timer fires, its handler starts the timer again and createAuthentication runs twice.

**Triggers:** When the two wake-up signals are separated by more than 300ms.

**Suggested fix:** Describe the timer as coalescing signal-triggered authentication requests that occur within 300ms rather than guaranteeing authentication is created only once.

```suggestion
    // On standby resume, ActiveChanged and PrepareForSleep are reported back to back;
    // the 300ms single-shot timer coalesces signal-triggered authentication requests
    // that occur within 300ms.
```
</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 Outdated
In the LockWorker constructor, add a descriptive comment to the wake-up
authentication timer setup. The comment explains the purpose of the
300ms single-shot timer: on standby resume, the ActiveChanged and
PrepareForSleep signals are emitted back-to-back, so the timer
guarantees authentication is created only once regardless of which
signal triggers first.

This is a documentation-only change with no functional modifications
to the code.

chore: 添加唤醒认证防抖定时器注释

在 LockWorker 构造函数中,为唤醒认证定时器设置添加了描述性注释。注
释说明了 300ms 单次触发定时器的用途:在待机恢复时,ActiveChanged 和
PrepareForSleep 信号会连续发出,因此该定时器确保无论哪个信号先触发,认证
只会创建一次。

这是一次纯文档变更,不涉及代码功能的任何修改。

Influence:
1. No functional changes; verify normal system wake-up and lock
functionality remains unaffected
2. Confirm no timing or race condition issues introduced during standby
resume

PMS: BUG-373405
deepin-ci-robot added a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request Sep 1, 2026
Synchronize source files from linuxdeepin/dde-session-shell.

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

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 52cyb, 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

@52cyb

52cyb commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit 7d5ce34 into linuxdeepin:master Sep 1, 2026
13 of 15 checks passed
52cyb pushed a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request Sep 1, 2026
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#83
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