Skip to content

Disable notifications on disconnect + race condition fix#227

Merged
vicocz merged 2 commits into
defaultfrom
local/fix-rc-before-disconnect-clean-up
May 25, 2026
Merged

Disable notifications on disconnect + race condition fix#227
vicocz merged 2 commits into
defaultfrom
local/fix-rc-before-disconnect-clean-up

Conversation

@vicocz
Copy link
Copy Markdown
Owner

@vicocz vicocz commented May 25, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves BLE disconnect behavior by explicitly disabling characteristic notifications before disconnecting, and hardens several OnCharacteristicChanged handlers against null characteristic references (avoiding a common disconnect/notification race).

Changes:

  • Add BeforeDisconnectAsync overrides to disable BLE notifications prior to disconnect for multiple device types.
  • Update OnCharacteristicChanged guards to handle cases where the notify characteristic reference is null (disconnect race / early callback).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
BrickController2/BrickController2/DeviceManagement/Wedo2Device.cs Disable sensor notification before disconnect.
BrickController2/BrickController2/DeviceManagement/PfxBrickDevice.cs Fix disconnect/notification race guard + disable notification before disconnect.
BrickController2/BrickController2/DeviceManagement/CircuitCubeDevice.cs Fix disconnect/notification race guard + disable notification before disconnect.
BrickController2/BrickController2/DeviceManagement/BuWizz3Device.cs Fix disconnect/notification race guard + disable notification before disconnect.
BrickController2/BrickController2/DeviceManagement/BuWizz2Device.cs Fix disconnect/notification race guard + disable notification before disconnect.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread BrickController2/BrickController2/DeviceManagement/PfxBrickDevice.cs Outdated
Comment thread BrickController2/BrickController2/DeviceManagement/CircuitCubeDevice.cs Outdated
Comment thread BrickController2/BrickController2/DeviceManagement/BuWizz3Device.cs Outdated
Comment thread BrickController2/BrickController2/DeviceManagement/BuWizz2Device.cs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@vicocz vicocz changed the title Disable notifications for other devices on disconnect + raise condition fix Disable notifications on disconnect + raise condition fix May 25, 2026
@vicocz vicocz marked this pull request as ready for review May 25, 2026 18:23
@vicocz vicocz changed the title Disable notifications on disconnect + raise condition fix Disable notifications on disconnect + race condition fix May 25, 2026
@vicocz vicocz merged commit 945e5cc into default May 25, 2026
6 checks passed
@vicocz vicocz deleted the local/fix-rc-before-disconnect-clean-up branch May 25, 2026 18:25
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.

2 participants