WebSocket text messages push empty heard[] until page refresh

Abierto
#398 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
django, python
Área
api, backend

Línea de trabajo

Start with TextMessageWSSerializer in Meshflow/ws/serializers.py and its get_heard(), then the notifier in Meshflow/ws/services/text_message.py, comparing against get_heard() in Meshflow/text_messages/serializers.py. The Meshtastic path reads prefetched_observations while MeshCore rows use original_mc_packet and MeshCorePacketObservation. Done when a live WS message shows the correct heard count for both packet types, checked against text_messages/tests/test_heard_api.py.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Type: bug | Area: WebSocket / text messages / heard

Problem

When viewing a message channel and a new message arrives over the WebSocket (live prepend), the message card shows 0 heard and does not update until a full page refresh. After refresh, REST list returns the correct heard count.

Reproduced on the messages page while staying on the active channel (message appears in the list in realtime, but heard count is wrong).

Likely cause

TextMessageWebSocketNotifier serializes via TextMessageWSSerializer.get_heard(), which only populates observations when original_packet.prefetched_observations exists (Meshtastic MessagePacket path). Otherwise it returns [].

MeshCore rows use original_mc_packet + MeshCorePacketObservation; REST TextMessageSerializer.get_heard() handles both — WS path does not mirror that yet. Notifier also does not prefetch observations at notify time.

Code: Meshflow/ws/serializers.py (TextMessageWSSerializer), Meshflow/ws/services/text_message.py, compare Meshflow/text_messages/serializers.py (get_heard).

Acceptance criteria

  • Live WS message on the active channel shows correct heard count (≥1 when feeders observed it) without refresh.
  • MT and MC messages both behave consistently with REST list/detail.
  • Optional: opening heard dialog from a WS-only row shows observers (or explicit empty state if truly none).

Related

Lenguaje dominante
Python
Estrellas
1
Forks
0
Merge medio
1 d 10 h
PR fusionados (30 d)
8

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pskillen/meshflow-api

Todos los issues de pskillen/meshflow-api

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.