Repository navigation
Conversation
1. The executable moved to /usr/libexec/deepin/langselector. /usr/lib/deepin-daemon/langselector remains a compatible entry point, using a wrapper and security loader to launch the new executable. 2. Logout cleanup only matched the old path, missing the actual process. Surviving processes retained their startup locale and cached translations, causing notifications to use a previous session's language. 3. Temporarily match both paths during logout, restricted to the current user. Anchor the command path and program name to avoid false matches. Abnormal session exits and reactivation after cleanup remain uncovered. Log: Fix stale notification translations after changing session language Influence: 1. Switch between English, Simplified Chinese and Traditional Chinese; log out and back in, then verify notification language. 2. Verify LangSelector processes from either path terminate on logout. 3. Verify cleanup does not affect other users or similarly named programs. fix: 注销时兼容清理新旧路径的 LangSelector 进程 1. LangSelector 的真实二进制已迁移至 /usr/libexec/deepin/langselector,旧路径 /usr/lib/deepin-daemon/langselector 保留为兼容启动入口, 通过 wrapper 和安全加载器启动新路径下的程序。 2. 原注销逻辑仅匹配旧路径,未覆盖新路径下的实际进程。 残留进程保留启动时的语言环境和翻译缓存,导致新会话切换语言时, 通知正文仍使用上一会话的语言。 3. 临时方案在注销时同时匹配新旧路径,兼容不同安装布局, 保留当前用户限制,并限定命令行起始位置和程序名边界, 避免误匹配其他进程。 此方案暂不覆盖会话异常退出及清理后再次激活的情况。 Log: 修复切换会话语言后通知正文沿用旧语言的问题 Influence: 1. 验证英文、简体中文、繁体中文之间切换并重新登录后的通知语言。 2. 验证新旧路径启动的 LangSelector 均能在注销时退出。 3. 验证不会清理其他用户的进程或名称相似的程序。 PMS: BUG-380095
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb 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 GuideUpdates logout cleanup so it terminates LangSelector processes launched from either the legacy /usr/lib/deepin-daemon path or the actual /usr/libexec/deepin path, preventing stale locale and translation state from surviving into a new session without affecting other users or similarly named programs. Sequence diagram for logout LangSelector cleanupsequenceDiagram
participant SessionManager
participant ProcessTable
participant LangSelector
SessionManager->>ProcessTable: stopLangSelector()
ProcessTable->>ProcessTable: Match current UID with anchored LangSelector paths
ProcessTable-->>SessionManager: Select legacy or actual path
SessionManager->>LangSelector: Terminate matched process
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰。正则表达式 ^/usr/(lib/deepin-daemon|libexec/deepin)/langselector([[:space:]]|$) 为有效的 POSIX ERE 模式,pkill -ef -u 命令结构正确,EXEC_COMMAND 宏通过 QProcess::start(cmd, args) 安全分离命令和参数执行,QString::number(getuid()) 正确转换 UID。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议在正则表达式参数上方添加简要注释,说明匹配的新旧两条路径(/usr/lib/deepin-daemon/langselector 和 /usr/libexec/deepin/langselector)以及锚定的目的,提高可维护性。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,资源使用合理。pkill 扫描 /proc 文件系统在注销场景下开销可接受,正则表达式简单无性能隐患。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞。正则表达式为编译期字符串字面量,无命令注入风险;getuid() 返回数值类型,无法被篡改;正则模式以 ^ 锚定起始、以 ([[:space:]]|$) 锚定结束,有效防止误匹配;-u 参数限制仅终止当前用户进程,确保用户隔离。 💡 改进建议代码示例// 建议在正则参数上方添加注释
void SessionManager::stopLangSelector()
{
// TODO 待优化,可以跟随当前用户一同退出
// 匹配新旧两条路径的 langselector 进程:
// /usr/lib/deepin-daemon/langselector (旧兼容入口)
// /usr/libexec/deepin/langselector (新实际路径)
EXEC_COMMAND("pkill"
, QStringList()
<< "-ef"
<< "-u"
<< QString::number(getuid())
<< "^/usr/(lib/deepin-daemon|libexec/deepin)/langselector([[:space:]]|$)"
);
}本报告由 AI 代码审查工具自动生成 |
Log: Fix stale notification translations after changing session language
Influence:
fix: 注销时兼容清理新旧路径的 LangSelector 进程
Log: 修复切换会话语言后通知正文沿用旧语言的问题
Influence:
PMS: BUG-380095
Summary by Sourcery
Bug Fixes: