Fixes lingering relays on loading follows outbox relays.
This commit is contained in:
+5
-1
@@ -24,6 +24,7 @@ import com.vitorpamplona.amethyst.commons.relayClient.eoseManagers.IEoseManager
|
||||
import com.vitorpamplona.amethyst.isDebug
|
||||
import com.vitorpamplona.amethyst.model.Account
|
||||
import com.vitorpamplona.amethyst.model.LocalCache
|
||||
import com.vitorpamplona.amethyst.model.LocalCache.users
|
||||
import com.vitorpamplona.amethyst.model.User
|
||||
import com.vitorpamplona.amethyst.service.BundledUpdate
|
||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.account.AccountQueryState
|
||||
@@ -150,7 +151,10 @@ class AccountFollowsLoaderSubAssembler(
|
||||
}
|
||||
}
|
||||
|
||||
if (users.isEmpty()) return null
|
||||
if (users.isEmpty()) {
|
||||
hasTried.removeEveryoneBut(emptySet())
|
||||
return null
|
||||
}
|
||||
|
||||
val connectedRelays = client.connectedRelaysFlow().value
|
||||
|
||||
|
||||
+3
-1
@@ -73,6 +73,7 @@ fun pickRelaysToLoadUsers(
|
||||
searchRelays - cannotConnectRelays,
|
||||
connected,
|
||||
commonRelays - cannotConnectRelays,
|
||||
cannotConnectRelays,
|
||||
hasTried,
|
||||
)
|
||||
}
|
||||
@@ -84,11 +85,12 @@ fun pickRelaysToLoadUsers(
|
||||
searchRelays: Set<NormalizedRelayUrl>,
|
||||
connected: Set<NormalizedRelayUrl>,
|
||||
commonRelays: Set<NormalizedRelayUrl>,
|
||||
cannotConnectRelays: Set<NormalizedRelayUrl>,
|
||||
hasTried: EOSEAccountFast<User>,
|
||||
): Map<NormalizedRelayUrl, Set<HexKey>> =
|
||||
mapOfSet {
|
||||
users.forEachIndexed { idx, key ->
|
||||
val tried = hasTried.since(key)?.keys ?: emptySet()
|
||||
val tried = (hasTried.since(key)?.keys ?: emptySet()) + cannotConnectRelays
|
||||
|
||||
val outbox = key.authorRelayList()?.writeRelaysNorm()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user