mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:25:20 +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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user