Skip to content

CoreBluetooth: pending operation futures dropped without reply on services-modified/clear #489

Description

@qdot

Several CoreBluetooth code paths drop pending operation futures without replying, so the awaiting caller hangs forever:

  • on_services_modified (src/corebluetooth/internal.rs ~L788) and on_discovered_services (~L859) replace/clear p.services, discarding every characteristic's read/write/notify queues and descriptor queues (including an already-submitted setNotifyValue). on_discovered_services building characteristics from an empty map also defeats the in-flight preservation added for Race condition causes panic on subscription in CoreBluetooth #167 in set_characteristics.
  • ClearPeripherals (~L1723) and the dead-sender eviction paths (~L741/761/777) drop the whole PeripheralInternal without calling drain_pending_operations.

Fix direction: drain (reply with an error to) pending futures before discarding services/peripherals, and preserve existing ServiceInternal/CharacteristicInternal state on re-discovery where the UUID still exists.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorebluetooth (macos/ios)Issues related to the MacOS/iOS CoreBluetooth impl

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions