reactions are still not correct #160

Closed
opened 2026-10-04 23:02:53 +02:00 by adam · 1 comment
Owner

what is this even?

[15:27:41][868][LF]  SHK4 ×2
[16:19:07][868][LF]  ERP1 Ping
[16:30:53][868][LF]  SHK4 ×2
[16:34:43][868][LF]  JUS2 ×4
[16:35:59][868][LF]  ERP1 Ping
[16:37:08][868][LF]  SHK4 ×2
[16:44:40][868][LF]  4e8d ×3
[17:34:02][868][LF]  3800 [in reply to ERP1] Pong
[19:50:48][868][LF]  CaO8 ×3
[19:54:52][868][LF]  SHK4 ×3
[19:55:02][868][LF]  SHK4 ×3
[20:31:22][868][LF]  NWHo 3 hops bis königsbach, wow
[20:31:31][868][LF]  NWHo 👍
[21:31:38][868][LF]  C271 1️⃣
what is this even? ``` [15:27:41][868][LF] SHK4 ×2 [16:19:07][868][LF] ERP1 Ping [16:30:53][868][LF] SHK4 ×2 [16:34:43][868][LF] JUS2 ×4 [16:35:59][868][LF] ERP1 Ping [16:37:08][868][LF] SHK4 ×2 [16:44:40][868][LF] 4e8d ×3 [17:34:02][868][LF] 3800 [in reply to ERP1] Pong [19:50:48][868][LF] CaO8 ×3 [19:54:52][868][LF] SHK4 ×3 [19:55:02][868][LF] SHK4 ×3 [20:31:22][868][LF] NWHo 3 hops bis königsbach, wow [20:31:31][868][LF] NWHo 👍 [21:31:38][868][LF] C271 1️⃣ ``` <!-- github-sync-id:4206955470 -->
adam closed this issue 2026-10-04 23:02:53 +02:00
Author
Owner

Problem: Backend (data/mesh_ingestor/handlers/generic.py:295-297) classifies a packet as a reaction when reply_id is not None and emoji is not None — even if the message has substantial text. Frontend
(web/public/assets/js/app/message-replies.js:288-303) mirrors this: hasEmoji && hasReplyId → reaction. A user replying "Great job! 👍" to a message gets misclassified.

Fix:

  1. Backend (generic.py): Tighten heuristic — require REACTION_APP portnum OR (reply_id + emoji + text is empty/single-emoji/numeric-placeholder). Add _is_likely_reaction(portnum, reply_id, emoji, text) helper.
  2. Frontend (message-replies.js): Add text-content check in isReactionMessage() — if message carries meaningful text beyond a bare emoji or numeric slot, return false even when hasEmoji && hasReplyId.
  3. Tests: Cover:
  • REACTION_APP portnum + emoji → true reaction
  • reply_id + emoji + no text → true reaction
  • reply_id + emoji + substantial text → NOT a reaction (the broken case)
  • Numeric emoji codepoint values
  • Placeholder slot values ("1")

Files:

  • data/mesh_ingestor/handlers/generic.py (lines 240-301)
  • web/public/assets/js/app/message-replies.js (lines 288-303)
  • tests/ — new or expanded reaction test cases
  • web/public/assets/js/app/tests/message-replies.test.js — new cases
Problem: Backend (data/mesh_ingestor/handlers/generic.py:295-297) classifies a packet as a reaction when reply_id is not None and emoji is not None — even if the message has substantial text. Frontend (web/public/assets/js/app/message-replies.js:288-303) mirrors this: hasEmoji && hasReplyId → reaction. A user replying "Great job! 👍" to a message gets misclassified. Fix: 1. Backend (generic.py): Tighten heuristic — require REACTION_APP portnum OR (reply_id + emoji + text is empty/single-emoji/numeric-placeholder). Add _is_likely_reaction(portnum, reply_id, emoji, text) helper. 2. Frontend (message-replies.js): Add text-content check in isReactionMessage() — if message carries meaningful text beyond a bare emoji or numeric slot, return false even when hasEmoji && hasReplyId. 3. Tests: Cover: - REACTION_APP portnum + emoji → true reaction - reply_id + emoji + no text → true reaction - reply_id + emoji + substantial text → NOT a reaction (the broken case) - Numeric emoji codepoint values - Placeholder slot values ("1") Files: - data/mesh_ingestor/handlers/generic.py (lines 240-301) - web/public/assets/js/app/message-replies.js (lines 288-303) - tests/ — new or expanded reaction test cases - web/public/assets/js/app/__tests__/message-replies.test.js — new cases <!-- github-comment-id:4251036080 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/potato-mesh#160