From 3d3c1b83389cd80e27d1fc04af243ca00f7aed45 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Mon, 28 Sep 2026 13:58:50 -0300 Subject: [PATCH] desktop: use the Android app's default relays DesktopSettings.defaultRelays was an ad-hoc list (oxtr.dev, theforest, relay.primal.net); mirror the Android app's defaultAppRelays instead (auth.nostr1.com, bucket.coracle.social, nrs.primal.net, relay.nip46.com, same order) so both signers talk to the same relays out of the box. Everything on the desktop side already reads the setting through AmberDesktop.defaultRelays(), so the single default covers the bunker connection, request routing, connect-response relay hints and the add-application screen. Fresh installs get the new set; saved settings.json files keep their relays. defaultRelaysMatchTheAndroidApp pins the list so the two apps cannot drift silently. --- .../nostrsigner/desktop/core/Models.kt | 8 +++++--- .../nostrsigner/desktop/DesktopCoreTest.kt | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/core/Models.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/core/Models.kt index f35628fd..2308f9e2 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/core/Models.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/core/Models.kt @@ -166,10 +166,12 @@ data class LogRecord( ) data class DesktopSettings( + /** Mirrors the Android app's `defaultAppRelays` (see AmberSettings.kt). */ val defaultRelays: List = listOf( - "wss://nostr.oxtr.dev/", - "wss://theforest.nostr1.com/", - "wss://relay.primal.net/", + "wss://auth.nostr1.com/", + "wss://bucket.coracle.social/", + "wss://nrs.primal.net/", + "wss://relay.nip46.com/", ), val currentAccount: String = "", val darkTheme: Boolean? = null, diff --git a/desktop/src/test/kotlin/com/greenart7c3/nostrsigner/desktop/DesktopCoreTest.kt b/desktop/src/test/kotlin/com/greenart7c3/nostrsigner/desktop/DesktopCoreTest.kt index b07eebe5..82cab7fc 100644 --- a/desktop/src/test/kotlin/com/greenart7c3/nostrsigner/desktop/DesktopCoreTest.kt +++ b/desktop/src/test/kotlin/com/greenart7c3/nostrsigner/desktop/DesktopCoreTest.kt @@ -51,6 +51,21 @@ class DesktopCoreTest { assertEquals(60, DesktopSettings().autoLockMinutes) } + @Test + fun defaultRelaysMatchTheAndroidApp() { + // Keep in sync with `defaultAppRelays` in the Android AmberSettings.kt. + assertEquals( + listOf( + "wss://auth.nostr1.com/", + "wss://bucket.coracle.social/", + "wss://nrs.primal.net/", + "wss://relay.nip46.com/", + ), + DesktopSettings().defaultRelays, + ) + assertEquals(4, DesktopSettings().normalizedDefaultRelays().size) + } + @Test fun parsesHexAndNsecKeys() { val hex = generateBunkerPrivKey()