Files
Meshtastic-Android/feature
James Rich b97ff4d712 refactor: Idempotent node ops (setFavorite/setIgnored) matching SDK
NodeController toggled favorite/ignore state by reading the current node
then flipping it (read-modify-write), which races concurrent callers and
forced a latent bug in SendMessageUseCase: it only ever wants to favorite
a node, but called a toggle, so a node that became favorite between the
guard and the call would have been un-favorited.

Replace with explicit-target idempotent operations mirroring the SDK's
AdminApi:

- favoriteNode(num) -> setFavorite(num, Boolean)
- ignoreNode(num)   -> setIgnored(num, Boolean)
- muteNode(num)     -> toggleMuted(num)   (mute is genuinely a firmware toggle)

Impls no-op when the node is already in the requested state. Callers
(NodeManagementActions confirm dialogs) pass !node.isFavorite from the
state the UI showed the user; SendMessageUseCase passes favorite = true.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 09:45:19 -05:00
..