-
Notifications
You must be signed in to change notification settings - Fork 55
fix: correct bubble ID handling in notification system #1319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR corrects bubble deletion by replacing an incorrect ID comparison in removeById, removes an unused ID‐mapping helper, and streamlines the closeBubble flow to use the supplied ID directly, removing unnecessary lookups and conversions. Sequence diagram for simplified bubble closing processsequenceDiagram
participant BubblePanel
participant BubbleModel
actor User
User->>BubblePanel: Request to close bubble (id)
BubblePanel->>BubbleModel: removeById(id)
BubbleModel->>BubblePanel: Bubble removed (if id matches)
BubblePanel->>User: Bubble closed (UI updated)
Class diagram for updated BubbleModel and BubblePanelclassDiagram
class BubbleModel {
- QList<BubbleItem*> m_bubbles
- QList<qint64> m_delayBubbles
+ void remove(int index)
+ void remove(const BubbleItem *bubble)
+ BubbleItem *removeById(qint64 id) // ID comparison fixed
+ void clear()
+ BubbleItem *bubbleItem(int bubbleIndex) const
}
class BubblePanel {
- BubbleModel *m_bubbles
- Accessor *m_accessor
+ void addBubble(qint64 id)
+ void closeBubble(qint64 id) // Simplified logic
}
BubblePanel --> BubbleModel
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich, yixinshark 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 |
Fixed incorrect bubble ID comparison in removeById method that was causing bubble deletion failures. The method was comparing against bubbleId() instead of id(), preventing proper bubble removal. Removed the unused getBubbleIdByStorageId method and simplified the closeBubble logic by directly using the provided ID without unnecessary entity lookups and ID conversions. The issue occurred because bubbleId and storageId were being confused in the deletion process. The removeById method was incorrectly checking bubbleId() instead of the actual item id(), making it impossible to find and remove bubbles by their correct identifier. This also eliminated the need for the complex ID mapping logic in closeBubble. Influence: 1. Test bubble deletion functionality by closing notification bubbles 2. Verify that bubbles are properly removed from the interface when closed 3. Check that no orphaned bubbles remain after deletion attempts 4. Test with multiple bubbles to ensure correct individual bubble removal 5. Verify bubble count decreases appropriately after deletions fix: 修正通知系统中气泡ID处理问题 修复了removeById方法中错误的气泡ID比较问题,该问题导致气泡删除失败。方 法之前比较的是bubbleId()而不是id(),阻止了正确的气泡移除。移除了未使用 的getBubbleIdByStorageId方法,并通过直接使用提供的ID简化了closeBubble逻 辑,无需不必要的实体查找和ID转换。 该问题的发生是因为在删除过程中混淆了bubbleId和storageId。removeById方法 错误地检查bubbleId()而不是实际的item id(),导致无法通过正确的标识符找到 和移除气泡。这也消除了closeBubble中复杂的ID映射逻辑的需求。 Influence: 1. 测试气泡删除功能,关闭通知气泡 2. 验证关闭时气泡是否正确从界面移除 3. 检查删除尝试后是否没有残留的孤立气泡 4. 使用多个气泡测试,确保正确移除单个气泡 5. 验证删除后气泡计数是否适当减少 PMS: BUG-337395
deepin pr auto review我来对这个git diff进行代码审查:
建议:
总体来说,这次代码改动是积极的,提高了代码的可读性和可维护性,同时保持了原有功能的完整性。 |
Fixed incorrect bubble ID comparison in removeById method that was
causing bubble deletion failures. The method was comparing against
bubbleId() instead of id(), preventing proper bubble removal. Removed
the unused getBubbleIdByStorageId method and simplified the closeBubble
logic by directly using the provided ID without unnecessary entity
lookups and ID conversions.
The issue occurred because bubbleId and storageId were being confused
in the deletion process. The removeById method was incorrectly checking
bubbleId() instead of the actual item id(), making it impossible to find
and remove bubbles by their correct identifier. This also eliminated the
need for the complex ID mapping logic in closeBubble.
Influence:
closed
removal
fix: 修正通知系统中气泡ID处理问题
修复了removeById方法中错误的气泡ID比较问题,该问题导致气泡删除失败。方
法之前比较的是bubbleId()而不是id(),阻止了正确的气泡移除。移除了未使用
的getBubbleIdByStorageId方法,并通过直接使用提供的ID简化了closeBubble逻
辑,无需不必要的实体查找和ID转换。
该问题的发生是因为在删除过程中混淆了bubbleId和storageId。removeById方法
错误地检查bubbleId()而不是实际的item id(),导致无法通过正确的标识符找到
和移除气泡。这也消除了closeBubble中复杂的ID映射逻辑的需求。
Influence:
PMS: BUG-337395
Summary by Sourcery
Fix bubble deletion by correcting ID comparison and streamlining closeBubble logic.
Bug Fixes:
Enhancements: