feat(join): tell apart the two ways of holding no invitation - #352
Merged
Merged
Conversation
"None held for this community" covered two situations that call for opposite treatment, and showed the row dim while suggesting you paste one on a later step — a greyed-out row telling you there is a way to act on it, which is exactly the confusion the routes list exists to remove. Which situation it is follows from the credential rather than from a guess. A VIC must name a `credentialSubject.id`: `validate_invitation_credential` refuses one without it, so there is no such thing as a bearer invitation, and that subject is a persona DID. So with no personas, no valid invitation can be *for* you — there is not even a DID one could have been issued to — and the row is genuinely shut, saying that rather than "none held". With a persona, one may well exist that this vault has not seen, and pasting it is a step the join can walk you through, so the row is live. That in turn exposed something the previous change would have shipped wrong: the take handler opened the create-persona overlay for *any* route that announced a first step. The invitation's first step is not an overlay, it is the page the route already leads to. `FirstStep` now carries its `FirstStepKind` — `CreatePersona` or `OnTheWay` — because inferring it from the route's identity would put the same reasoning in two places and get it wrong in one of them. 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.
Follow-up to #351, applying the same rule to the row it left inconsistent. Single commit on
main.The observation
A VIC can only be issued to a persona DID that exists. So no persona implies no
invitation is possible; personas existing means one might exist.
That is provable, not a heuristic.
validate_invitation_credential(inopenvtc-core/src/join.rs) requirescredentialSubject.id— a credentialwithout one is refused — so there is no such thing as a bearer invitation, and
that subject is a persona DID.
What was wrong
"Use an invitation" showed one row for both situations: dim, reading "none held
for this community — paste one on the invitation step if you have one the vault
has not seen". A greyed-out row telling you there is a way to act on it, which
is the shape of confusion the routes list exists to remove — the same objection
that produced #351, left half-applied.
Now
Blocked— "an invitation is issued to one of your personas, and you have none yet"FirstStep— "none is in your vault, so this starts by asking you to paste one — if you have none, the step offers to join without it"ReadyBlockedA bug this caught in #351
RouteState::FirstStepcarried only a note, and the take handler opened thecreate-persona overlay for any route that announced a first step. That was
fine while the vetting route was the only one — and would have been wrong the
moment the invitation route announced one, which is this PR.
The invitation's first step is not an overlay; it is the page the route already
leads to. So
FirstStepnow carriesFirstStepKind:Inferring that from the route's identity would have put the same reasoning in
two places and got it wrong in one of them.
Testing
cargo fmt --all --check,cargo clippy --all-targets --all-features— cleancargo test --all-features -- --include-ignored— all greenRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features— cleanRe-run after rebasing onto
mainwith #351 in it.holding_no_invitation_is_shut_without_a_persona_and_a_step_with_one— bothhalves, in one test, so they cannot drift apart.
the_two_first_steps_are_different_steps— pins the kinds, which is theassertion that would have caught the overlay bug above.