Skip to content

fix: RNode announces via BLE shown with Bluetooth icon#525

Merged
torlando-tech merged 1 commit intomainfrom
fix/rnode-ble-interface-type-main
Feb 22, 2026
Merged

fix: RNode announces via BLE shown with Bluetooth icon#525
torlando-tech merged 1 commit intomainfrom
fix/rnode-ble-interface-type-main

Conversation

@torlando-tech
Copy link
Copy Markdown
Owner

Summary

  • RNode interfaces connected via BLE get names like ColumbaRNodeInterface[RNode 5A3F BLE]
  • fromInterfaceName() and categorizeInterface() checked for "ble" before "rnode", so these were misclassified as BLE/Bluetooth instead of RNode/LoRa
  • Reorders the when-branches so "rnode" is checked before "ble" in both InterfaceType.kt and ReceivingInterfaceInfo.kt

Test plan

  • Added regression test in InterfaceTypeTest for "ColumbaRNodeInterface[RNode 5A3F BLE]"RNODE
  • Added regression test in ReceivingInterfaceInfoTest for same name → CellTower icon
  • All existing tests pass

🤖 Generated with Claude Code

RNode interfaces connected via BLE get names like "ColumbaRNodeInterface[RNode 5A3F BLE]".
The `fromInterfaceName()` and `categorizeInterface()` functions checked for "ble" before
"rnode", so these were misclassified as ANDROID_BLE/BLUETOOTH instead of RNODE/LORA.

Reorder the when-branches so "rnode" is checked before "ble" in both InterfaceType and
ReceivingInterfaceInfo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 22, 2026

Greptile Summary

Fixes a bug where RNode interfaces connected via BLE were incorrectly categorized as Bluetooth devices instead of LoRa/RNode devices. The issue occurred because interface names like ColumbaRNodeInterface[RNode 5A3F BLE] contain both "rnode" and "ble" substrings, and the pattern matching logic checked for "ble" before "rnode".

Changes:

  • Reordered pattern matching in InterfaceType.fromInterfaceName() to check for rnode before ble
  • Reordered pattern matching in categorizeInterface() to check for rnode/lora before ble/bluetooth
  • Added regression tests in both InterfaceTypeTest and ReceivingInterfaceInfoTest to prevent future regressions

The fix ensures RNode devices are always correctly classified regardless of their connection transport, while preserving correct behavior for genuine BLE interfaces like BLEPeerInterface.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Simple bug fix with clear root cause and solution. Changes only reorder pattern matching checks without modifying logic. Comprehensive regression tests added for the specific bug case. All existing tests continue to pass (including BLEPeerInterface). No side effects on other interface types.
  • No files require special attention

Important Files Changed

Filename Overview
data/src/main/java/com/lxmf/messenger/data/model/InterfaceType.kt Reordered when-branch to check rnode before ble to fix misclassification of BLE-connected RNodes
app/src/main/java/com/lxmf/messenger/ui/util/ReceivingInterfaceInfo.kt Reordered when-branch to check rnode/lora before ble/bluetooth for correct icon categorization
data/src/test/java/com/lxmf/messenger/data/model/InterfaceTypeTest.kt Added regression test to verify BLE-connected RNodes return RNODE type, not ANDROID_BLE
app/src/test/java/com/lxmf/messenger/ui/util/ReceivingInterfaceInfoTest.kt Added regression test to verify BLE-connected RNodes show CellTower icon, not Bluetooth icon

Last reviewed commit: c6863ba

@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@torlando-tech torlando-tech merged commit b523648 into main Feb 22, 2026
14 checks passed
@torlando-tech torlando-tech deleted the fix/rnode-ble-interface-type-main branch February 22, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant