mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 12:25:22 +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:
@@ -44,6 +44,33 @@ struct BLEOutboundFragmentTransferSchedulerTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func strictDirectTransferIsRejectedWithoutBeingQueuedWhenSlotsAreFull() {
|
||||
var scheduler = BLEOutboundFragmentTransferScheduler()
|
||||
let active = makeRequest(type: MessageType.fileTransfer.rawValue, transferId: "active")
|
||||
let strict = makeRequest(
|
||||
type: MessageType.fileTransfer.rawValue,
|
||||
transferId: "strict",
|
||||
requireDirectPeerLink: true
|
||||
)
|
||||
|
||||
guard case .start = scheduler.submit(active, maxConcurrentTransfers: 1) else {
|
||||
Issue.record("Expected active transfer to reserve the only slot")
|
||||
return
|
||||
}
|
||||
|
||||
let result = scheduler.submit(strict, maxConcurrentTransfers: 1)
|
||||
|
||||
if case let .rejectedStrict(request, transferId) = result {
|
||||
#expect(request.requireDirectPeerLink)
|
||||
#expect(transferId == "strict")
|
||||
#expect(scheduler.activeCount == 1)
|
||||
#expect(scheduler.pendingCount == 0)
|
||||
} else {
|
||||
Issue.record("Expected strict transfer to reject instead of entering the pending queue")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func submitQueuesDuplicateActiveTransferAtFront() {
|
||||
var scheduler = BLEOutboundFragmentTransferScheduler()
|
||||
@@ -240,7 +267,8 @@ struct BLEOutboundFragmentTransferSchedulerTests {
|
||||
type: UInt8,
|
||||
transferId: String?,
|
||||
payload: String? = nil,
|
||||
directedPeer: PeerID? = nil
|
||||
directedPeer: PeerID? = nil,
|
||||
requireDirectPeerLink: Bool = false
|
||||
) -> BLEOutboundFragmentTransferRequest {
|
||||
BLEOutboundFragmentTransferRequest(
|
||||
packet: BitchatPacket(
|
||||
@@ -255,7 +283,8 @@ struct BLEOutboundFragmentTransferSchedulerTests {
|
||||
pad: false,
|
||||
maxChunk: nil,
|
||||
directedPeer: directedPeer,
|
||||
transferId: transferId
|
||||
transferId: transferId,
|
||||
requireDirectPeerLink: requireDirectPeerLink
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user