From d0f2f08e19601840943fce4f8bf61df26a16546a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 17 Jul 2026 23:50:53 +0000 Subject: [PATCH] fix(blossom): mirror and blob-manager use only the user's configured servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01Ckbnz1N94W1hnNC9xpsCNP --- .../amethyst/service/uploads/UploadOrchestrator.kt | 8 +++++--- .../actions/mediaServers/BlossomBlobManagerViewModel.kt | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/UploadOrchestrator.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/UploadOrchestrator.kt index fe264d3f0d..a10a63d66a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/UploadOrchestrator.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/UploadOrchestrator.kt @@ -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 diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/mediaServers/BlossomBlobManagerViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/mediaServers/BlossomBlobManagerViewModel.kt index baf6f84481..39acd1ee82 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/mediaServers/BlossomBlobManagerViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/mediaServers/BlossomBlobManagerViewModel.kt @@ -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 = - account.blossomServers.hostNameFlow.value - .filter { it.type == ServerType.Blossom } - .map { it.baseUrl } + account.blossomServers.flow.value .distinct() fun refresh() {