From 3f677776bbe1bd97fdabb5752ba989b060947543 Mon Sep 17 00:00:00 2001 From: jack Date: Tue, 7 Jul 2026 21:13:48 +0200 Subject: [PATCH] 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 --- bitchat/Services/NostrTransport.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitchat/Services/NostrTransport.swift b/bitchat/Services/NostrTransport.swift index 197a3034..9dd6ad68 100644 --- a/bitchat/Services/NostrTransport.swift +++ b/bitchat/Services/NostrTransport.swift @@ -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")