WebSocket text messages push empty heard[] until page refresh

オープン
#398 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
django, python
領域
api, backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
1
フォーク
0
平均マージ
23時間 9分
マージ済み PR(30日)
15

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pskillen/meshflow-api のほかの issue

pskillen/meshflow-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。