mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-06-02 11:12:05 -04:00
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>