Repository navigation
fix: clear stale boardVendorKey in else branch - #875
Conversation
1. Root cause: checkBoardVendorFlag() else branch does not clear static boardVendorKey before dmidecode matching, leaving stale cache from previous calls across device type changes 2. Fix: add boardVendorKey = "" at else branch entry to reset cache, ensuring clean state before model detection begins 3. Impact: M900/W525 fallback logic now triggers correctly when no known model matches; specialComType != -1 branch unaffected Log: Fixed board vendor detection on unknown device models Influence: 1. Test board vendor detection on known models (KLVV/KLVU/PGUV/PGUW/PGUX) 2. Test M900/W525 fallback when dmidecode returns unknown model 3. Verify no regression on specialComType-based device detection fix: 修复 else 分支中 boardVendorKey 缓存残留问题 1. 根因:checkBoardVendorFlag() else 分支在 dmidecode 匹配前未清空 静态变量 boardVendorKey,导致跨调用缓存残留 2. 方案:在 else 分支入口处添加 boardVendorKey = "" 重置缓存, 确保机型检测前状态干净 3. 影响:未知机型时 M900/W525 兜底逻辑恢复正常触发;不影响 specialComType != -1 分支 Log: 修复未知机型设备的主板厂商检测问题 Influence: 1. 测试已知机型(KLVV/KLVU/PGUV/PGUW/PGUX)的主板厂商检测 2. 测试未知机型时 M900/W525 兜底逻辑是否正常触发 3. 验证 specialComType 分支的设备检测无回归 PMS: BUG-V-6376
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis fix eliminates stale boardVendorKey state across device-type changes by clearing the cache before fallback model detection, allowing unknown-model M900/W525 handling to trigger correctly without affecting specialComType-based detection. Sequence diagram for board vendor detection cache resetsequenceDiagram
participant Caller
participant Common
participant Dmidecode
Caller->>Common: checkBoardVendorFlag()
alt specialComType != -1
Common-->>Caller: board vendor result
else fallback model detection
Common->>Common: boardVendorKey = ""
Common->>Dmidecode: start("dmidecode", "-s system-product-name")
Dmidecode-->>Common: system product name
alt known model match
Common-->>Caller: board vendor result
else unknown model
Common-->>Caller: M900/W525 fallback result
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind 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 |
|
/merge |
|
This pr cannot be merged! (status: unknown) |
|
/forcemerge |
1 similar comment
|
/forcemerge |
fix: clear stale boardVendorKey in else branch
static boardVendorKey before dmidecode matching, leaving stale
cache from previous calls across device type changes
ensuring clean state before model detection begins
known model matches; specialComType != -1 branch unaffected
Log: Fixed board vendor detection on unknown device models
Influence:
fix: 修复 else 分支中 boardVendorKey 缓存残留问题
静态变量 boardVendorKey,导致跨调用缓存残留
确保机型检测前状态干净
specialComType != -1 分支
Log: 修复未知机型设备的主板厂商检测问题
Influence:
PMS: BUG-V-6376
Summary by Sourcery
Bug Fixes: