fix: correct DBus service validity check in UpdateDbusProxy#297
Merged
Conversation
Changed the validity check from `isValid()` to `serviceValid()` for the DBus manager interface. The original method incorrectly checked the interface object itself rather than verifying whether the underlying DBus service is actually registered and available. This caused status retrieval issues after the lastore-daemon service registration, as the check would succeed even when the service wasn't fully operational. Log: Fixed service status check in DBus proxy Influence: 1. Test service registration and status retrieval flow for lastore- daemon 2. Verify that proxy correctly detects when DBus service is unavailable 3. Test edge cases where service deregisters during operation fix: 修正 UpdateDbusProxy 中 DBus 服务的有效性检查 将有效性检查从 `isValid()` 改为 `serviceValid()`。原先的方法错误地检查 了接口对象本身,而不是验证底层 DBus 服务是否已真正注册并可用。这会导致在 lastore-daemon 服务注册后获取状态出现问题,因为在服务未完全就绪时也能通 过检查。 Log: 修复 DBus 代理中的服务状态检查 Influence: 1. 测试 lastore-daemon 的服务注册和状态获取流程 2. 验证代理在 DBus 服务不可用时能正确检测 3. 测试服务在运行中注销的边界情况 PMS: BUG-361789 Change-Id: Ie796f222f20cb83ef8e04f2723bdad1d1f5e766f
deepin pr auto review你好!我是CodeGeeX,你的智能编程助手。我已仔细审查了你提供的 Git Diff 代码。 本次修改仅涉及一行代码的变更,将 以下是针对本次修改在语法逻辑、代码质量、代码性能和代码安全方面的详细审查意见: 1. 语法与逻辑审查
2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
总结与修改建议代码如果你确认业务上只需要判断服务是否存在,建议对函数名进行同步重构,并在注释中说明原因,避免后续维护者误改回 // 修改前:
// bool managerInterIsValid() const { return m_managerInter && m_managerInter->isValid(); }
// 修改后建议:
// 注意:此处使用 serviceValid() 仅校验远端服务是否在总线注册,不校验底层 QDBusConnection 的连通性。
// 调用方必须处理异步调用可能产生的 QDBusError。
bool managerServiceIsValid() const { return m_managerInter && m_managerInter->serviceValid(); }如果你发现实际上是需要保证通道完全可用,建议撤销此次修改,保留原有的 |
mhduiy
approved these changes
May 19, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, xionglinlin 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the validity check from
isValid()toserviceValid()for the DBus manager interface. The original method incorrectly checked the interface object itself rather than verifying whether the underlying DBus service is actually registered and available. This caused status retrieval issues after the lastore-daemon service registration, as the check would succeed even when the service wasn't fully operational.Log: Fixed service status check in DBus proxy
Influence:
fix: 修正 UpdateDbusProxy 中 DBus 服务的有效性检查
将有效性检查从
isValid()改为serviceValid()。原先的方法错误地检查 了接口对象本身,而不是验证底层 DBus 服务是否已真正注册并可用。这会导致在lastore-daemon 服务注册后获取状态出现问题,因为在服务未完全就绪时也能通
过检查。
Log: 修复 DBus 代理中的服务状态检查
Influence:
PMS: BUG-361789
Change-Id: Ie796f222f20cb83ef8e04f2723bdad1d1f5e766f