From 9d29304b8186495b5d7bddffca42e1bcf1d7c0ce Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 29 Sep 2026 13:44:29 -0400 Subject: [PATCH] fix(concord): put the community's current name in the invites we mint Invites carried the Community List entry's name, which is the name the community had when we joined, so a renamed community's links previewed its old name in every client. Use the folded metadata name, falling back to the entry's, both when minting and when a Refounding re-mints existing links. Co-Authored-By: Claude Opus 5.5 --- .../commons/model/AccountConcordActions.kt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/AccountConcordActions.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/AccountConcordActions.kt index 83d8cc5d4a..d9229873d9 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/AccountConcordActions.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/AccountConcordActions.kt @@ -157,6 +157,18 @@ class AccountConcordActions( announceConcordGuestbookJoin(entry, inviteCreator, inviteLabel) } + /** The community's current name: its folded metadata, else the name it was joined under. */ + private fun currentConcordName( + session: ConcordCommunitySession?, + entry: ConcordCommunityListEntry, + ): String = + session + ?.state + ?.value + ?.metadata + ?.name + ?.takeIf { it.isNotBlank() } ?: entry.name + private suspend fun awaitConcordSession(communityId: HexKey) { withTimeoutOrNull(SESSION_WAIT_MS) { account.concordSessions.revision.first { account.concordSessions.sessionFor(communityId) != null } @@ -381,6 +393,7 @@ class AccountConcordActions( rootEpoch = entry.rootEpoch, controlPk = entry.controlPk, relays = entry.relays, + name = currentConcordName(account.concordSessions.sessionFor(entry.id), entry), ) // Confirmed: a link counted as moved but never stored is a link its // holders can no longer redeem, reported as a success. @@ -427,7 +440,9 @@ class AccountConcordActions( ownerSaltHex = entry.ownerSalt, communityRootHex = entry.root, rootEpoch = entry.rootEpoch, - name = entry.name, + // The folded metadata, not the List entry: the entry keeps the name it was joined + // under, so a renamed community's invites previewed its old name. + name = currentConcordName(session, entry), relays = entry.relays, // The joiner can never derive the Control Plane address, so the bundle carries // it (CORD-05 ยง1). Null on a legacy community, which has none to carry.