From 9c2cccd68d46f5968594063f5d8b5144d7309d3b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 29 Sep 2026 12:31:06 -0400 Subject: [PATCH] fix(concord): re-issue a legacy Admin role without role_id on Make admin An Admin role published before Role content carried role_id is dropped by Armada, along with every Grant naming it, so promoting a member silently did nothing there. Re-define it at the same id before granting. Co-Authored-By: Claude Opus 5.5 --- .../amethyst/commons/model/AccountConcordActions.kt | 7 +++++++ 1 file changed, 7 insertions(+) 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 0ebe09d709..71d107fb9f 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 @@ -1126,6 +1126,13 @@ class AccountConcordActions( roleId.toHexKey() } + // An Admin role published before Amethyst wrote `role_id` into Role content is invisible + // to Armada, which then drops this Grant too. Re-issue it at the same id to heal it. + if (existing != null && existing.value.roleId.isNullOrEmpty()) { + val healWrap = ConcordModeration.defineRole(account.signer, cp, communityId.hexToByteArray(), roleIdHex.hexToByteArray(), existing.value, session.controlEditions(), TimeUtils.now(), owner = session.entry.owner) + publishConcordWrap(session.entry, healWrap) + } + // Admin carries every management bit, so this Grant makes its member staff: it must // deliver the control_root alongside the rank (CORD-04 ยง3), or the new admin holds // authority it cannot publish under.