Skip to content

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Oct 28, 2025

Changed the timeout value from receiveFileNeverTimeout to receiveFileNotifyTimeout for OBEX file transfer progress notifications. This fixes an issue where notifications would remain indefinitely without proper timeout handling, potentially causing stale notifications to persist in the system. The new timeout ensures notifications are automatically dismissed after a reasonable period, improving user experience and system resource management.

fix: 更新 OBEX 文件传输通知超时设置

将 OBEX 文件传输进度通知的超时值从 receiveFileNeverTimeout 更改为
receiveFileNotifyTimeout。这修复了通知可能无限期保留而缺乏适当超时处理的
问题,避免了陈旧通知在系统中持续存在。新的超时设置确保通知在合理时间后自
动消失,改善了用户体验和系统资源管理。

PMS: BUG-304197

Summary by Sourcery

Replace the indefinite timeout with a notify-specific timeout for OBEX file transfer progress notifications to ensure they are auto-dismissed after a reasonable period.

Bug Fixes:

  • Use receiveFileNotifyTimeout instead of receiveFileNeverTimeout for OBEX file transfer notifications to prevent stale notifications.

Enhancements:

  • Improve user experience and system resource management by auto-dismissing file transfer notifications.

Changed the timeout value from receiveFileNeverTimeout to
receiveFileNotifyTimeout for OBEX file transfer progress notifications.
This fixes an issue where notifications would remain indefinitely
without proper timeout handling, potentially causing stale notifications
to persist in the system. The new timeout ensures notifications are
automatically dismissed after a reasonable period, improving user
experience and system resource management.

fix: 更新 OBEX 文件传输通知超时设置

将 OBEX 文件传输进度通知的超时值从 receiveFileNeverTimeout 更改为
receiveFileNotifyTimeout。这修复了通知可能无限期保留而缺乏适当超时处理的
问题,避免了陈旧通知在系统中持续存在。新的超时设置确保通知在合理时间后自
动消失,改善了用户体验和系统资源管理。

PMS: BUG-304197
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 28, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Changed the OBEX file transfer notification timeout setting to use receiveFileNotifyTimeout instead of receiveFileNeverTimeout, ensuring notifications automatically time out and improving resource management.

Class diagram for OBEX file transfer notification timeout update

classDiagram
    class obexAgent {
        +notifyProgress(notify, replaceID, actions, hints)
    }
    class notifications {
        +Notifications
    }
    obexAgent --> notifications: uses
    class receiveFileNeverTimeout
    class receiveFileNotifyTimeout
    obexAgent ..> receiveFileNotifyTimeout: uses (updated)
    obexAgent ..x receiveFileNeverTimeout: no longer used
Loading

File-Level Changes

Change Details Files
Use receiveFileNotifyTimeout instead of receiveFileNeverTimeout for OBEX progress notifications
  • Replaced receiveFileNeverTimeout constant with receiveFileNotifyTimeout
  • Updated notifyProgress call to use the new timeout value
  • Improved notification lifecycle by enforcing auto-dismiss behavior
bluetooth1/obex_agent.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个diff进行仔细审查:

  1. 语法逻辑:

    • 这是一个简单的参数值修改,将receiveFileNeverTimeout改为receiveFileNotifyTimeout
    • 语法上没有任何问题,符合Go语言的函数调用语法
  2. 代码质量:

    • 这个改动提高了代码的可维护性,因为从命名来看:
      • receiveFileNeverTimeout 表示永不超时
      • receiveFileNotifyTimeout 表示通知超时
    • 新的命名更准确地描述了参数的用途,这是一个好的实践
  3. 代码性能:

    • 这个改动不会影响性能,因为只是替换了一个常量/变量的引用
  4. 代码安全:

    • 这个改动可能会影响安全性,因为从永不超时改为有超时设置:
      • 优点:防止了资源无限期占用,提高了系统的稳定性
      • 需要注意:要确保receiveFileNotifyTimeout的值设置合理,既不能太短导致正常传输失败,也不能太长失去超时的意义

改进建议:

  1. 建议在代码中添加注释,说明为什么要有这个超时设置,以及超时值的选择依据
  2. 建议在常量定义处添加文档注释,说明这个超时时间的具体用途
  3. 如果这个超时时间比较关键,建议添加单元测试来验证超时行为是否符合预期

总体来说,这是一个好的改动,提高了代码的健壮性和可维护性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, wjyrich

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wjyrich wjyrich merged commit 472b320 into linuxdeepin:master Oct 28, 2025
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants