fix(auto-ack): skip incoming tapback/reaction packets in Auto-Acknowledge - #4571
fix(auto-ack): skip incoming tapback/reaction packets in Auto-Acknowledge#4571Yeraze wants to merge 1 commit into
Conversation
…edge Incoming reaction packets (emoji flag set) were fed into checkAutoAcknowledge like any other text message, so Auto-Ack's tapback cell would react to a tapback someone else placed on a message. Apps never display a reply to a reaction, so this was a pure airtime waste. checkAutoAcknowledge now returns early for any packet carrying the emoji flag, before regex matching or settings reads. Fixes #4569 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MSo3oMwB3PiR4t3m8JZAG9
|
Claude finished @Yeraze's task —— View job PR Review: fix(auto-ack): skip incoming tapback/reaction packets in Auto-Acknowledge
SummaryThis is a clean, well-scoped fix. The core change is correct and the placement of the early-return guard is optimal. Implementation Review (
|
|
Thanks for the review. Agreed on the observation about -- Authored by Roger 🤓 Generated by Claude Code |
|
Superseded by #4574, which merged as This PR got there first — opened 22:44 UTC, ~20 minutes before #4574 — and I missed it when I picked up the issue. Apologies for the duplicated effort. The two fixes are the same idea in the same function, with one real difference worth keeping from this one: if (message.emoji) // here — truthy
if (message?.emoji != null) // what mergedThey diverge only on I'm porting that to Closing as superseded — not as wrong. |
…nce (#4589) Ported from #4571, which had this right and was closed as superseded by #4574 after arriving first. Credit where due. The merged guard read `message?.emoji != null`. Meshtastic's `emoji` is a FLAG whose zero value means "not a reaction", so `!= null` classified a literal `emoji: 0` as a tapback and would have skipped acking an ordinary message. Unreachable today: the TEXT_MESSAGE_APP decode normalizes 0 to undefined (`decodedEmoji > 0 ? decodedEmoji : undefined`), so both spellings behave identically on the live path. But that made the guard silently dependent on a normalization several thousand lines away — move it, or add an ingestion path that skips it, and auto-ack quietly stops responding. Keying on the flag's own semantics removes the coupling. Verified red/green: the new `emoji: 0` case fails against `!= null` and passes with the truthiness test, while the other five assertions (including the explicit-null control) are unchanged either way. Claude-Session: https://claude.ai/code/session_01EtJnjbUgYwJfNU6XXACbFf Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
TEXT_MESSAGE_APPpackets with theemojiflag set (payload text is the emoji itself).checkAutoAcknowledgenever checked this flag, so any incoming reaction packet was processed like a normal message and could trigger an Auto-Ack reply/tapback.checkAutoAcknowledge(src/server/meshtasticManager.ts) now returns early whenever the incoming packet carries theemojiflag, before any regex matching or settings reads.Test plan
src/server/meshtasticManager.autoAckSkipReaction.test.ts: a reaction packet (emoji: 1) never reachesmessageQueue.enqueue, while a normal text message still does (control case).npx vitest runon all existing Auto-Ack-related suites (meshtasticManager.autoAck*.test.ts,utils/autoAckDecision.test.ts) — all pass.npm run lint:ci— clean, no ratchet growth.npx tsc --noEmit— clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01MSo3oMwB3PiR4t3m8JZAG9
Generated by Claude Code