Mark AckPacer @unchecked Sendable

Its mutable state is confined to the serial pacer queue; the annotation
silences the capture-of-non-Sendable warning in the scheduler callback
(NostrTransport.swift:123) under the app target's concurrency checking.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jack
2026-07-07 21:13:48 +02:00
co-authored by Claude Fable 5
parent 5dffb04912
commit 3f677776bb
+4 -1
View File
@@ -89,7 +89,10 @@ final class NostrTransport: Transport, @unchecked Sendable {
/// ever hold one item and never pace a burst (flagged by Codex on
/// #1398). Production wires `sharedAckPacer` via `Dependencies.live`;
/// tests get an isolated instance per `Dependencies` by default.
final class AckPacer {
/// @unchecked Sendable: all mutable state (`pending`, `isSending`) is
/// confined to the serial `queue`; the class is only touched via
/// `enqueue` and the scheduler callback, both of which hop onto it.
final class AckPacer: @unchecked Sendable {
typealias Scheduler = @Sendable (TimeInterval, @escaping @Sendable () -> Void) -> Void
private let queue = DispatchQueue(label: "chat.bitchat.nostr-ack-pacer")