Skip to content

feat(community): cancel a pending join to withdraw + remove it#133

Merged
stormer78 merged 1 commit into
mainfrom
feat/cancel-pending-join
Jun 17, 2026
Merged

feat(community): cancel a pending join to withdraw + remove it#133
stormer78 merged 1 commit into
mainfrom
feat/cancel-pending-join

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Problem

A Pending community (from a join request) could not be deleted, archived, or left — those actions are all 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 that leaves the join stuck Pending) had no way to back out and retry.

What this does

Adds a cancel pending join action:

  • c on a Pending row (y/n confirmed) → transitions the membership to a new terminal CommunityStatus::Withdrawn and tears down its now-dead DIDComm session.
  • Withdrawn is inactive (archive/delete eligible) and re-joinable, and — like Left — a voluntary outcome that never raises the actions-required badge.
  • The user can then press d to delete it, or just re-join. Mirrors the existing leave → delete pattern.

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 the withdrawn status 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.

  • The inbound status-response handler now reconciles a VTC-reported withdrawn to the same Withdrawn state.
  • Real VTC notification is a follow-up: it needs a join-requests/withdraw/1.0 message added to vta-sdk in the VTI repo first (the protocol layer lives there), then wired at the TODO(VTI) in the WithdrawJoin action.

Changes (8 files)

  • openvtc-core/src/config/account.rsWithdrawn variant; is_inactive() / needs_attention() updates; guarded withdraw() 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 async WithdrawJoin handler (best-effort notify + transition + session teardown).
  • openvtc/src/state_handler/main_page/...is_pending summary field, Withdrawn status label.
  • openvtc/src/ui/pages/main/...c-key gating (pending-only), confirm prompt, help-text c: cancel.

Tests

New unit tests for: the withdraw() transition + guards, status classification, the withdrawn serde tag, inbound status-response reconciliation, and the c-key gating + confirm flow.

cargo build, cargo test, and cargo clippy all green (one pre-existing clippy warning at mod.rs:138, untouched).

Follow-up

  • VTI: add join-requests/withdraw/1.0 to vta-sdk so cancel can actively notify the VTC, then wire the send here (see TODO(VTI)).

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>
@stormer78 stormer78 requested a review from a team as a code owner June 17, 2026 14:06
@stormer78 stormer78 merged commit 838b9ac into main Jun 17, 2026
6 of 13 checks passed
@stormer78 stormer78 deleted the feat/cancel-pending-join branch June 17, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant