fix(join): restore public.friendly_name when a minted-persona join is rolled back#123
Merged
Conversation
… rolled back `mint_persona_into` sets `public.friendly_name` to the attempted community's persona name. On a failed or cancelled join the minted persona is rolled back, but `friendly_name` was left pointing at a community we never joined — leaving the self-display name wrong until the user fixes it manually. Capture `public.friendly_name` before the mint (in `join_flow`) and thread it through `run_join_sequence` to `rollback_minted_persona`, which now restores it alongside removing the persona record / identity / key_info. Covers all six rollback paths (the cancel/interrupt site + the five mid-sequence failures). Reuse joins are unaffected (they never mint, so `friendly_name` is untouched). Gate: cargo fmt; clippy --workspace --all-targets -D warnings; cargo test --workspace — all green. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mint_persona_intosetspublic.friendly_nameto the attempted community'spersona name. On a failed or cancelled join the minted persona is rolled
back (
rollback_minted_persona), butfriendly_namewas left pointing at acommunity we never joined — the self-display name stays wrong until the user
edits it by hand. (Noted as a small known follow-up from the join/cancel-safety
work.)
Fix
Capture
public.friendly_namebefore the mint (injoin_flow) and thread itthrough
run_join_sequenceintorollback_minted_persona, which now restoresit alongside removing the persona record / identity / key_info. Covers all six
rollback paths — the cancel/interrupt site plus the five mid-sequence failure
sites (sub-context derive/create, ATM-unavailable, identity-missing, submit
failure). Reuse joins are unaffected (they never mint, so
friendly_nameisnever touched).
Tests / gate
cargo fmt;clippy --workspace --all-targets -D warnings;cargo test --workspace— all green.Config::save) and is exercised by manualverification + the in-code cancel-site rollback (consistent with the existing
rollback_minted_personacoverage note); this change is a localized restorewith no new I/O.