mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 12:25:19 +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:
@@ -72,4 +72,38 @@ struct BLEOutboundWriteBufferTests {
|
||||
|
||||
#expect(buffer.peripheralIDs.isEmpty)
|
||||
}
|
||||
|
||||
@Test
|
||||
func acceptanceReportsWhenNewLowPriorityWriteIsTrimmed() {
|
||||
var buffer = BLEOutboundWriteBuffer()
|
||||
let peerID = "peer-1"
|
||||
_ = buffer.enqueue(
|
||||
data: Data(repeating: 0x01, count: 8),
|
||||
for: peerID,
|
||||
priority: .high,
|
||||
capBytes: 8
|
||||
)
|
||||
|
||||
let attempt = buffer.enqueueReportingAcceptance(
|
||||
data: Data(repeating: 0x02, count: 8),
|
||||
for: peerID,
|
||||
priority: .low,
|
||||
capBytes: 8
|
||||
)
|
||||
|
||||
#expect(!attempt.accepted)
|
||||
#expect(buffer.takeAll(for: peerID).compactMap(\.data.first) == [0x01])
|
||||
}
|
||||
|
||||
@Test
|
||||
func disconnectDiscardRemovesOnlyThatPeripheralQueue() {
|
||||
var buffer = BLEOutboundWriteBuffer()
|
||||
_ = buffer.enqueue(data: Data([1]), for: "gone", priority: .high, capBytes: 100)
|
||||
_ = buffer.enqueue(data: Data([2]), for: "live", priority: .high, capBytes: 100)
|
||||
|
||||
buffer.discardAll(for: "gone")
|
||||
|
||||
#expect(buffer.takeAll(for: "gone").isEmpty)
|
||||
#expect(buffer.takeAll(for: "live").map(\.data) == [Data([2])])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user