fix(power1): comment out pre-login power mode update#1166
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR disables the pre-login power mode initialization call in the power manager so that power mode is only applied once via the post-login flow, avoiding double-setting failures in deepin-power-control. Sequence diagram for updated power mode setting after loginsequenceDiagram
actor User
participant LoginSession
participant PowerManager
participant deepin_power_control
User->>LoginSession: startSession
LoginSession->>PowerManager: updatePowerMode
PowerManager->>deepin_power_control: setPowerMode
Note over PowerManager: init no longer calls updatePowerMode before login
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Instead of commenting out
m.updatePowerMode(true), consider removing the call entirely or guarding it with a clear conditional to avoid leaving dead code that may be accidentally re-enabled later. - If init-time power mode updates are now intentionally disabled, verify whether any callers or startup flows implicitly relied on that behavior and, if needed, centralize the post-login update logic to make the new lifecycle explicit in code.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Instead of commenting out `m.updatePowerMode(true)`, consider removing the call entirely or guarding it with a clear conditional to avoid leaving dead code that may be accidentally re-enabled later.
- If init-time power mode updates are now intentionally disabled, verify whether any callers or startup flows implicitly relied on that behavior and, if needed, centralize the post-login update logic to make the new lifecycle explicit in code.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…eepin-power-control 1. Removed sync.Once + time.AfterFunc(2 min) that forcibly restored the original power mode after login 2. Changed boot logic to keep performance mode until first user session, then set the original mode via updatePowerMode(true) 3. Moved initial updatePowerMode(true) from init() into doSetMode's short-idle path to avoid double-setting power mode — deepin-power-control may fail when called twice in quick succession 4. Cleaned up unused imports and redundant error check Log: Fix power mode racing by deferring initialization to post-login, removing the flawed timer-based reset fix(power): 将电源模式初始化移到登录后,避免与 deepin-power-control 竞争 1. 移除登录后2分钟强制恢复电源模式的定时器逻辑 2. 启动时保持 performance 模式,直到第一个用户会话登录后才设置 为原有的电源模式 3. 将 updatePowerMode(true) 从 init() 移到 doSetMode 的短空闲路径, 避免短时间内重复设置电源模式——deepin-power-control 连续设置2次 有概率失败 4. 清理未使用的导入和冗余错误检查 Log: 将电源模式初始化延迟到登录后执行,移除有缺陷的定时器复位逻辑 PMS: BUG-367237
a2aae5d to
a58400b
Compare
Log: Comment out pre-login updatePowerMode to prevent double-setting failure
fix(power1): 注释掉登录前的电源模式更新
Log: 注释掉登录前的电源模式更新,避免短时间重复设置导致失败
PMS: BUG-367237
Summary by Sourcery
Bug Fixes: