fix(perf): disable auto_update_contacts to prevent serial blocking

auto_update_contacts=True triggers ensure_contacts() on every
ADVERTISEMENT event, fetching 324+ contacts over serial (several seconds).
This blocks the serial port and delays MESSAGES_WAITING processing,
causing 10-30s message reception delays. Contacts are synced at startup
and updated individually via NEW_CONTACT events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-03-02 07:48:08 +01:00
parent 63f2473933
commit 2c547ee1fc
+4 -1
View File
@@ -172,7 +172,10 @@ class DeviceManager:
await self._subscribe_events()
# Enable auto-refresh of contacts on adverts/path updates
self.mc.auto_update_contacts = True
# Keep auto_update_contacts OFF to avoid serial blocking on every
# ADVERTISEMENT event (324 contacts = several seconds of serial I/O).
# We sync contacts at startup and handle NEW_CONTACT events individually.
self.mc.auto_update_contacts = False
# Fetch initial contacts from device
await self.mc.ensure_contacts()