// // NostrTransportTests.swift // bitchat // // This is free and unencumbered software released into the public domain. // For more information, see // import Foundation import Testing @testable import bitchat @Suite("NostrTransport Thread Safety Tests") struct NostrTransportTests { @Test("Concurrent read receipt enqueue does not crash") @MainActor func concurrentReadReceiptEnqueue() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) let transport = NostrTransport(keychain: keychain, idBridge: idBridge) // Create 100 concurrent read receipt submissions let iterations = 100 await withTaskGroup(of: Void.self) { group in for i in 0..