fix(blossom): mirror and blob-manager use only the user's configured servers

Both the mirror-on-upload fan-out and the blob-manager matrix read the raw
kind-10063 list (BlossomServerListState.flow) instead of hostNameFlow, which
injects the 10 public DEFAULT_MEDIA_SERVERS when the user has none set. This
avoids fanning uploads out to — and listing/HEAD-probing across — public
servers the user never opted into.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ckbnz1N94W1hnNC9xpsCNP
This commit is contained in:
Claude
2026-07-17 23:50:53 +00:00
parent bb03cd2a3c
commit d0f2f08e19
2 changed files with 9 additions and 6 deletions
@@ -263,11 +263,13 @@ class UploadOrchestrator {
val hash = result.sha256 ?: sourceUrl.substringAfterLast('/').substringBefore('.')
if (hash.length != 64) return
// Only the user's *explicitly configured* kind-10063 servers (flow), NOT the
// DEFAULT_MEDIA_SERVERS fallback that hostNameFlow injects — we must never fan
// uploads out to public defaults the user never opted into.
val primaryDomain = BlossomServerUrl.domain(primaryServerBaseUrl)
val targets =
account.blossomServers.hostNameFlow.value
.filter { it.type == ServerType.Blossom && BlossomServerUrl.domain(it.baseUrl) != primaryDomain }
.map { it.baseUrl }
account.blossomServers.flow.value
.filter { BlossomServerUrl.domain(it) != primaryDomain }
.distinct()
if (targets.isEmpty()) return
@@ -80,10 +80,11 @@ class BlossomBlobManagerViewModel : ViewModel() {
private fun clientFor(server: String) = BlossomClient(Amethyst.instance.roleBasedHttpClientBuilder.okHttpClientForUploads(server))
// The user's explicitly configured kind-10063 servers (empty if they never set
// a list) — not the DEFAULT_MEDIA_SERVERS fallback, so the matrix reflects the
// servers the user actually chose.
private fun servers(): List<String> =
account.blossomServers.hostNameFlow.value
.filter { it.type == ServerType.Blossom }
.map { it.baseUrl }
account.blossomServers.flow.value
.distinct()
fun refresh() {