From d7d1b052fefe462fe5fa048372e30a53338f394a Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 31 Jul 2026 15:54:29 -0400 Subject: [PATCH] fix(relays): file the account's own contact cards under account data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Observing Profiles" showed up for accounts that had no screen at all, which is the one thing that purpose is explained as never being: "profiles of the people currently on screen". ContactCardFilters has two builders sharing SubPurpose.PROFILE_METADATA, and only one of them observes anything. filterContactCardsToTargetKeysFromTrustedAccounts… fetches kind:30382 cards ABOUT the users on screen — that one is right. filterContactCardsByAuthorInTheRelay fetches the account's OWN nicknames in the login-time bulk download, from the account's own relays, with nobody on screen; its own KDoc said as much while the purpose said otherwise. It rides filterAccountInfoAndListsFromKey, so every logged-in account carried one of these per relay — Dr Martha Liz's two relays showed as "Observing Profiles · 2 filters · 2 relays" for an account nobody was looking at. It is account data, and now says so. Verified on emulator-5554: only the account on screen still reports Observing Profiles; the other three carry Account's data alone. Co-Authored-By: Claude Opus 5 (1M context) --- .../relayClient/assemblers/ContactCardFilters.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt index f8d8c3a973..87df5fba9c 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt @@ -59,9 +59,14 @@ fun filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay( } /** - * Every kind:30382 card *written by* [author] — the account's own nicknames — - * for the bulk download at login from the account's relays. Addressable events: + * Every kind:30382 card *written by* [authors] — the accounts' own nicknames — + * for the bulk download at login from the accounts' own relays. Addressable events: * one card per target user, hence the larger limit. + * + * [SubPurpose.ACCOUNT_DATA], not [SubPurpose.PROFILE_METADATA] like its sibling above: nobody has to + * be on screen for this to run. It is part of the login-time account load, so filing it under + * "Observing Profiles" — explained as *"profiles of the people currently on screen"* — made every + * logged-in account look like it was watching somebody. */ fun filterContactCardsByAuthorInTheRelay( relay: NormalizedRelayUrl, @@ -73,8 +78,8 @@ fun filterContactCardsByAuthorInTheRelay( relay = relay, filter = ExplainedFilter( - purpose = SubPurpose.PROFILE_METADATA, - // This variant fetches an account's OWN contact card, so the author is the owner. + purpose = SubPurpose.ACCOUNT_DATA, + // This variant fetches the accounts' OWN contact cards, so the authors are the owners. accountPubKeys = authors, kinds = ContactCardKindList, authors = authors,