feat(community): cancel a pending join to withdraw + remove it#133
Merged
Conversation
A Pending join could not be deleted, archived, or left: those actions are gated to inactive states, and Pending is neither. The only escape was the 7-day client timeout. A user who joined the wrong community (or hit a stale DIDComm session) was stuck with no way to back out and retry. Add a cancel action on Pending rows (the 'c' key, y/n confirmed) that transitions the membership to a new terminal CommunityStatus::Withdrawn and tears down its now-dead session, so it can then be deleted or re-joined. Withdrawn is inactive (archive/delete eligible) and, like Left, a voluntary outcome that never raises the actions-required badge. The VTC notification is best-effort: vta-sdk has no applicant-side withdraw DIDComm message yet (only the 'withdrawn' status the VTC reports), so the cancel is fully local for now and the request also lapses to the VTC's own timeout. The inbound status-response handler now reconciles a VTC-reported 'withdrawn' to the same state. A follow-up will wire a real withdraw message once vta-sdk gains one. Adds unit tests for the withdraw transition, status classification, serde tag, inbound reconciliation, and the c-key gating/confirm flow. 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
A
Pendingcommunity (from a join request) could not be deleted, archived, or left — those actions are all gated to inactive states, andPendingis neither. The only escape was the 7-day client timeout. A user who joined the wrong community (or hit a stale DIDComm session that leaves the join stuckPending) had no way to back out and retry.What this does
Adds a cancel pending join action:
con a Pending row (y/n confirmed) → transitions the membership to a new terminalCommunityStatus::Withdrawnand tears down its now-dead DIDComm session.Withdrawnis inactive (archive/delete eligible) and re-joinable, and — likeLeft— a voluntary outcome that never raises the actions-required badge.dto delete it, or just re-join. Mirrors the existingleave → deletepattern.VTC notification is best-effort (for now)
vta-sdk — including 0.17, the version the library/binary actually build against (the 0.12 git pin is test-only via
vta-service) — has no applicant-side withdraw DIDComm message, only thewithdrawnstatus the VTC reports in a status-response. So the cancel is fully local for now; the request also lapses to the VTC's own timeout.withdrawnto the sameWithdrawnstate.join-requests/withdraw/1.0message added to vta-sdk in the VTI repo first (the protocol layer lives there), then wired at theTODO(VTI)in theWithdrawJoinaction.Changes (8 files)
openvtc-core/src/config/account.rs—Withdrawnvariant;is_inactive()/needs_attention()updates; guardedwithdraw()transition (Pending-only).openvtc-core/src/messaging.rs— inbound"withdrawn"reconciliation.openvtc/src/state_handler/...—Action::{CommunityConfirmWithdraw, CommunityCancelWithdraw, WithdrawJoin}, arm/disarm nav handling, and the asyncWithdrawJoinhandler (best-effort notify + transition + session teardown).openvtc/src/state_handler/main_page/...—is_pendingsummary field,Withdrawnstatus label.openvtc/src/ui/pages/main/...—c-key gating (pending-only), confirm prompt, help-textc: cancel.Tests
New unit tests for: the
withdraw()transition + guards, status classification, thewithdrawnserde tag, inbound status-response reconciliation, and thec-key gating + confirm flow.cargo build,cargo test, andcargo clippyall green (one pre-existing clippy warning atmod.rs:138, untouched).Follow-up
join-requests/withdraw/1.0to vta-sdk so cancel can actively notify the VTC, then wire the send here (seeTODO(VTI)).