mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-06 08:43:17 +02:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user