Skip to content

fix(meshcore): schedule channel sync from WS worker thread (#91)#125

Merged
pskillen merged 1 commit into
mainfrom
bot-91/paddy/fix-apply-mc-channel-sync
Jun 2, 2026
Merged

fix(meshcore): schedule channel sync from WS worker thread (#91)#125
pskillen merged 1 commit into
mainfrom
bot-91/paddy/fix-apply-mc-channel-sync

Conversation

@pskillen
Copy link
Copy Markdown
Owner

@pskillen pskillen commented Jun 2, 2026

Summary

  • Fix apply_mc_channel_config failing after writing channels to the device with no running event loop.
  • on_apply_mc_channel_config runs on a WebSocket worker thread (asyncio.to_thread); post-apply schedule_channel_sync incorrectly called asyncio.create_task on that thread.
  • Add _submit_coro_to_radio_loop to use create_task on the MeshCore loop thread or run_coroutine_threadsafe from other threads.

Related

Testing performed

  • pytest test/meshcore/test_radio_channel_sync.py -v --no-cov
  • Manually verified apply from UI after bot restart (local)

apply_mc_channel_config runs on asyncio.to_thread; post-apply
schedule_channel_sync used create_task without a running loop.
Submit sync coroutines via run_coroutine_threadsafe when off-loop.

Closes #91
@pskillen pskillen merged commit 8e5a351 into main Jun 2, 2026
3 checks passed
@pskillen pskillen deleted the bot-91/paddy/fix-apply-mc-channel-sync branch June 2, 2026 14:02
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.

[MeshCore P2] Bot — sync MeshCore channel config with radio and API

2 participants