Files
pyxis/lib/tdeck_ui
torlando-tech 9699a15a2d fix(ui): coalesce ConversationListScreen refresh on inbound flood
on_message_received() called \`_conversation_list_screen->refresh()\`
unconditionally per message. Under propagation-sync flood (50+ queued
messages delivered back-to-back) that's 50 full LVGL list redraws,
each holding LVGL_LOCK across:
  - lv_obj_clean(_list) + reload conversations from MessageStore
  - per-conversation container construction
  - per-peer Identity::recall_app_data calls for display names
  - SPI display flush

The refreshes serialize behind LVGL_LOCK, the SPI bus stays saturated
flushing dirty regions, and pyxis's USB CDC TX buffer overflows
because the main loop is too busy with display work to drain the
serial-output FIFO. Harness commands time out as a side effect.

Replace the per-message refresh with a coalescing flag drained from
update():
  - on_message_received only sets _pending_conversation_refresh
  - update() refreshes at most once per 750ms
  - update() also skips the refresh entirely when the user isn't on
    the conversation list (show_conversation_list refreshes when they
    navigate back, so nothing's lost — a chat-screen user gets quiet
    background ingestion)

Validated under a 2-round LXMF soak: direct + opportunistic short and
medium messages all PASS round-trip with the coalescing in effect.
Propagation flake is unchanged (known timing issue between pyxis
upload and bot's 8s sync poll, not a UI regression).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 02:59:40 -04:00
..