Fix built-in relay actor isolation (#1528)

This commit is contained in:
Kudala Bharani Kumar Reddy 2026-07-30 12:56:35 -04:00 committed by GitHub
parent b49400ff0c
commit e8f95e9a88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -153,14 +153,18 @@ final class NostrRelayManager: ObservableObject {
// Built-in relays carry private-message envelopes, so avoid relays known to
// reject the kinds they use.
private static let builtInRelays = [
nonisolated private static let builtInRelays = [
"wss://relay.damus.io",
"wss://nos.lol",
"wss://relay.primal.net",
"wss://offchain.pub"
// For local testing, you can add: "ws://localhost:8080"
]
private static let builtInRelaySet = Set(builtInRelays.compactMap { NostrRelayURL.normalized($0) })
/// Exposed so the relay settings UI can reject re-adding a built-in.
/// `nonisolated` because it is an immutable constant with no actor state.
nonisolated static let builtInRelayURLs = Set(
builtInRelays.compactMap { NostrRelayURL.normalized($0) }
)
/// The relays private messages target: the built-in set plus any added by
/// hand. Four hardcoded hostnames are four names for a censor to block, so
@ -182,10 +186,6 @@ final class NostrRelayManager: ObservableObject {
defaultRelaySet = Set(defaultRelays)
}
/// Exposed so the relay settings UI can reject re-adding a built-in.
/// `nonisolated` because it is an immutable constant with no actor state.
nonisolated static var builtInRelayURLs: Set<String> { builtInRelaySet }
@Published private(set) var relays: [Relay] = []
@Published private(set) var isConnected = false
/// Whether a relay that carries private messages is connected. DMs