mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:25:20 +00:00
Harden PTT audio and the 1.7.1 release (#1423)
Centralize PTT and voice audio-session ownership, harden courier/bridge/outbox delivery and recovery, correct location and delivery-state races, add privacy/release metadata, and ship reproducible universal Arti slices with Release CI coverage. Validated by the full iOS suite, repeated audio/fragment/performance regressions, BitFoundation tests, strict lint and dead-code analysis, universal iOS Release builds, and iOS/macOS archives.
This commit is contained in:
@@ -46,6 +46,33 @@ struct BLEOutboundLinkPlannerTests {
|
||||
)
|
||||
|
||||
#expect(plan.fragmentChunkSize == BLEOutboundPacketPolicy.fragmentChunkSize(forLinkLimit: smallestLimit))
|
||||
#expect(plan.selectedLinks.peripheralIDs == Set(["p1"]))
|
||||
#expect(plan.selectedLinks.centralIDs == Set(["c1"]))
|
||||
#expect(!plan.shouldSpoolDirectedPacket)
|
||||
}
|
||||
|
||||
@Test
|
||||
func oversizedDirectedCourierDoesNotUseUnrelatedPeersMTUAsHandoffSuccess() {
|
||||
let recipient = PeerID(str: "1122334455667788")
|
||||
let unrelated = PeerID(str: "8877665544332211")
|
||||
let packet = makePacket(type: .courierEnvelope, recipient: recipient)
|
||||
|
||||
let plan = BLEOutboundLinkPlanner.plan(
|
||||
packet: packet,
|
||||
dataCount: 512,
|
||||
peripheralIDs: ["unrelated-link"],
|
||||
peripheralWriteLimits: [64],
|
||||
centralIDs: [],
|
||||
centralNotifyLimits: [],
|
||||
ingressRecord: nil,
|
||||
excludedLinks: [],
|
||||
peripheralPeerBindings: ["unrelated-link": unrelated],
|
||||
directedOnlyPeer: recipient,
|
||||
requireDirectPeerLink: true
|
||||
)
|
||||
|
||||
#expect(plan.directedPeerHint == recipient)
|
||||
#expect(plan.fragmentChunkSize == nil)
|
||||
#expect(plan.selectedLinks.peripheralIDs.isEmpty)
|
||||
#expect(plan.selectedLinks.centralIDs.isEmpty)
|
||||
#expect(!plan.shouldSpoolDirectedPacket)
|
||||
@@ -93,6 +120,28 @@ struct BLEOutboundLinkPlannerTests {
|
||||
#expect(plan.shouldSpoolDirectedPacket)
|
||||
}
|
||||
|
||||
@Test
|
||||
func bridgeCourierPacketDoesNotTurnProcessLocalSpoolIntoHandoffSuccess() {
|
||||
let recipient = PeerID(str: "1122334455667788")
|
||||
let packet = makePacket(type: .courierEnvelope, recipient: recipient)
|
||||
|
||||
let plan = BLEOutboundLinkPlanner.plan(
|
||||
packet: packet,
|
||||
dataCount: 32,
|
||||
peripheralIDs: [],
|
||||
peripheralWriteLimits: [],
|
||||
centralIDs: [],
|
||||
centralNotifyLimits: [],
|
||||
ingressRecord: nil,
|
||||
excludedLinks: [],
|
||||
directedOnlyPeer: recipient
|
||||
)
|
||||
|
||||
#expect(plan.selectedLinks.peripheralIDs.isEmpty)
|
||||
#expect(plan.selectedLinks.centralIDs.isEmpty)
|
||||
#expect(!plan.shouldSpoolDirectedPacket)
|
||||
}
|
||||
|
||||
@Test
|
||||
func publicBroadcastDoesNotSpoolWhenNoLinksAreAvailable() {
|
||||
let packet = makePacket(type: .message)
|
||||
|
||||
Reference in New Issue
Block a user