Skip to content

Stop calling the deprecated Host.send_command_sync() - #1004

Merged
barbibulle merged 1 commit into
google:mainfrom
coredevices:send-command-sync-deprecation
Oct 10, 2026
Merged

barbibulle merged 1 commit into
google:mainfrom
coredevices:send-command-sync-deprecation

Conversation

@gmarull

@gmarull gmarull commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Host.send_command_sync() is deprecated in favor of utils.AsyncRunner.spawn(host.send_async_command(...)), but Bumble still calls it internally, so any user gets a warning on every pairing:

bumble/smp.py:1064: DeprecationWarning: Use utils.AsyncRunner.spawn() instead.
  self.manager.device.host.send_command_sync(

This replaces the remaining internal callers:

  • smp.Session.start_encryption()
  • l2cap.ChannelManager.on_l2cap_connection_parameter_update_request()
  • Device.on_connection_request() (accept and reject)

Behavior is unchanged: send_command_sync() was already just a wrapper around that spawn.

Tested: pytest tests/smp_test.py tests/l2cap_test.py tests/device_test.py tests/self_test.py -W "error:Use utils.AsyncRunner:DeprecationWarning": 243 passed. black and mypy are clean.

Host.send_command_sync() is deprecated in favor of spawning
send_async_command() with utils.AsyncRunner.spawn(), but the SMP, L2CAP
and Device code still call it, so every pairing, connection parameter
update and BR/EDR connection request emits a DeprecationWarning from
within Bumble itself.

Spawn send_async_command() directly in those places.
@zyv

zyv commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Nice work. I wanted to submit this today, but you preempted me. It would be good to get this merged so that my test suite stops flooding me with deprecation warnings :)

@barbibulle barbibulle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the improvements

@barbibulle
barbibulle merged commit 53f9efc into google:main Oct 10, 2026
36 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