[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:
jack
2026-05-31 14:08:30 +02:00
committed by GitHub
co-authored by jack
parent ab0da61533
commit df36b19afe
18 changed files with 1503 additions and 383 deletions
+30
View File
@@ -163,6 +163,36 @@ struct BLEServiceCoreTests {
#expect(ble._test_recordIngressIfNew(packet: packet, linkID: "central-a"))
#expect(!ble._test_recordIngressIfNew(packet: packet, linkID: "central-b"))
}
@Test
func modifiedServices_rediscoverWhenBitChatServiceIsInvalidated() async throws {
let otherService = CBUUID(string: "0000180F-0000-1000-8000-00805F9B34FB")
#expect(BLEService._test_shouldRediscoverBitChatService(
invalidatedServiceUUIDs: [BLEService.serviceUUID],
cachedServiceUUIDs: [otherService]
))
}
@Test
func modifiedServices_rediscoverWhenCachedServicesNoLongerIncludeBitChat() async throws {
let otherService = CBUUID(string: "0000180F-0000-1000-8000-00805F9B34FB")
#expect(BLEService._test_shouldRediscoverBitChatService(
invalidatedServiceUUIDs: [otherService],
cachedServiceUUIDs: [otherService]
))
}
@Test
func modifiedServices_ignoreUnrelatedInvalidationWhenBitChatIsStillCached() async throws {
let otherService = CBUUID(string: "0000180F-0000-1000-8000-00805F9B34FB")
#expect(!BLEService._test_shouldRediscoverBitChatService(
invalidatedServiceUUIDs: [otherService],
cachedServiceUUIDs: [BLEService.serviceUUID, otherService]
))
}
}
private func makeService() -> BLEService {