Remove dead name-based dedup code after PR #630#633
Merged
torlando-tech merged 1 commit intomainfrom Mar 9, 2026
Merged
Conversation
PR #630 stopped advertising device names in BLE scan responses. This made shouldSkipDiscoveredDevice() always return false since it relied on matching "RNS-"/"Reticulum-" prefixes in advertised names. The GATT-layer identity dedup remains intact. Removed: - shouldSkipDiscoveredDevice() and its scanner callback wrapper - recentlyDeduplicatedIdentities map + deduplicationCooldownMs - BleAdvertiser.setTransportIdentity() + transportIdentityHash - IDENTITY_BYTES_IN_ADVERTISED_NAME constant - 15 dead tests and 6 dead test helpers - Stale detekt baseline entry and docs references Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR is a clean dead-code removal pass following PR #630, which stopped advertising identity-based device names. Because devices no longer advertise an Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[BLE Scanner discovers device] --> B[onDeviceDiscovered callback]
B --> C["Log: Device discovered (address, name, RSSI)"]
C --> D[Build serviceUuidsArray]
D --> E[onDeviceDiscovered.callAttr to Python]
subgraph REMOVED ["❌ Removed (dead since PR #630)"]
R1["shouldSkipDiscoveredDevice(device.name)"]
R2["recentlyDeduplicatedIdentities map"]
R3["deduplicationCooldownMs = 60,000ms"]
R4["BleAdvertiser.setTransportIdentity()"]
R5["IDENTITY_BYTES_IN_ADVERTISED_NAME = 3"]
end
subgraph REMAINS ["✅ Remains — GATT-layer dedup"]
G1[handleIdentityReceived]
G2{Dual connection?}
G3[DedupeAction.CLOSE_CENTRAL]
G4[DedupeAction.CLOSE_PERIPHERAL]
G1 --> G2
G2 -- yes --> G3
G2 -- yes --> G4
end
E --> REMAINS
Last reviewed commit: eb0c3e1 |
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shouldSkipDiscoveredDevice()and all supporting infrastructure (recentlyDeduplicatedIdentities,deduplicationCooldownMs,IDENTITY_BYTES_IN_ADVERTISED_NAME) — dead since PR fix: stop changing phone's Bluetooth device name during BLE advertising #630 stopped advertising device namesBleAdvertiser.setTransportIdentity()and its callers inKotlinBLEBridgeandBleConnectionManager— advertiser no longer needs identity for name computationpendingCentralConnections+ 2onAddressChanged)docs/ble-architecture.mdand detekt baselineNo behavioral change — the GATT-layer identity dedup in
handleIdentityReceived()remains fully intact and handles all deduplication correctly.Test plan
:reticulum:compileDebugKotlinpasses:reticulum:testDebugUnitTest --tests "*.KotlinBLEBridgeDeduplicationTest"— 5 remaining tests pass:app:compileNoSentryDebugKotlinpassesgrepfor all removed symbols returns zero matches🤖 Generated with Claude Code