mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 05:05:19 +00:00
[codex] Refine BLE ingress fanout (#1280)
* Refactor BLE transport event handling * Make image output paths unique * Keep queued Nostr read receipts alive * Refine BLE ingress fanout * Rediscover BLE service after invalidation * Extract BLE notification retry buffer * Extract BLE inbound write buffer * Extract BLE fragment assembly buffer * Tidy secure log handling from device run * Allow self-authored RSR ingress replies * Harden read receipt queue test timing --------- Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -50,6 +50,26 @@ struct RelayControllerTests {
|
||||
#expect(decision.delayMs >= 10 && decision.delayMs <= 35)
|
||||
}
|
||||
|
||||
@Test
|
||||
func localRecipientDoesNotRelayDirectedTraffic() async {
|
||||
let decision = RelayController.decide(
|
||||
ttl: 7,
|
||||
senderIsSelf: false,
|
||||
recipientIsSelf: true,
|
||||
isEncrypted: true,
|
||||
isDirectedEncrypted: true,
|
||||
isFragment: false,
|
||||
isDirectedFragment: false,
|
||||
isHandshake: false,
|
||||
isAnnounce: false,
|
||||
degree: 3,
|
||||
highDegreeThreshold: TransportConfig.bleHighDegreeThreshold
|
||||
)
|
||||
|
||||
#expect(!decision.shouldRelay)
|
||||
#expect(decision.newTTL == 7)
|
||||
}
|
||||
|
||||
@Test
|
||||
func fragment_relaysWithFragmentCap() async {
|
||||
let decision = RelayController.decide(
|
||||
|
||||
Reference in New Issue
Block a user