Remove an identity from this device
A person removes an identity they no longer want on the phone, after a confirmation that says it cannot be undone.

As an identity holder, I want to remove an identity from my phone, knowingly, so that the phone only holds the keys I still use.

Situation

I have an identity here that I no longer need on this phone, or I am handing the phone to someone. I have checked that I hold its recovery words or a key file. I am on the Me tab.

What I do

    For an identity that is not in use: swipe its row to the left and tap the delete button.

    For any identity, including the current one: open it and tap "Remove from this device" at the bottom.

    Read the alert and tap "Remove".

What I should see

    With several identities, Me says "Tap an identity to use it. Swipe to remove it from this device."

    Only the smaller rows can be swiped. The current identity is removed from its own page. See Identity detail.

    "Remove from this device" is the last row of that page, in red.

    Both ways open the same alert, titled "Remove this identity?", with "Its key is deleted from this device. Without its recovery phrase or a key file, it can’t be recovered." and the buttons "Remove" in red and "Cancel".

    Nothing is removed until I tap "Remove".

    After removing from the page, I am taken back to Me.

    The identity is gone from Me and from the Vault list.

    Removing an identity I was not using leaves my current identity as it was.

    Removing the current identity makes my oldest remaining identity current.

    Removing my last identity leaves Me saying "No identity yet" with "Create identity" and "Import identity".

    Any key file that was revealed on screen is hidden.

When something goes wrong

    If I change my mind, "Cancel" closes the alert and the identity stays.

    If I removed the wrong one, I bring it back with its recovery words or key file through Import an identity I already have. Without either, it is lost.

Not included

    The alert speaks only of this device. When a remote vault is connected, the removal also travels to the vault and takes the identity off my other devices at their next sync, and the alert does not say so. See Keep my identities in sync across devices.

    There is no undo and no waiting period.

    My public profile, documents and comments stay published. Removing a key does not delete anything from the network.

    If the removal fails because the identity is already gone, no message is shown.

    The app does not check that I have a backup first.

Trace

Story US-ID-06, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.

Design

Page

Part it plays

Me

Swipe to remove on the other identity rows, the footer hint and the alert

Identity detail

Remove from this device as the last red row, with its alert

Vault

The vault list that also loses the identity

Identity rows

Which rows can be swiped and which cannot

dialog

The Remove this identity? alert

button

The destructive row and the swipe delete action

Confirmations and alerts

Destructive confirmation wording and button order

Buttons and actions

Destructive actions are red, last and ask first

Lists

Swipe actions on list rows

Every list in the app

Lists the identities list and its swipe action

States for every screen

The No identity yet state after the last removal

Honest state: loading, failure and empty

The empty state names the next step

Representative strings

The exact alert wording

Platform colour roles in use

System red for the destructive row

Implementation

Page

Part it plays

Me: identities and servers

Orientation: the package that owns identities

Me: screens and components

meAskRemove chooses the dialog; meRemove and meAfterRemove

Me: sources and import logic

meRemoveIdentity and which account becomes current next

Identity: key storage

removeKey writes the key removal and its marker in one Keychain write

Vault: the store and on-device format

reconcile turns a removal marker into a deletion in the vault

Vault: merge and tombstones

How a deletion spreads to other devices and when a re-created identity survives

Vault: screens and tasks

vaultTrackMe notices the changed identity list

Root declarations: Me, Profile, Crypto and Vault

meAimed and meRemoved

State, refresh and stale-reply patterns

meRemoved refreshes the identity list, then sets the current account

Contract views and built-in calls

The delete swipe action and showModal

Contract UI tests

The UI tests that remove by swipe and from the detail page

Bun unit tests

Unit tests for the next current account and the removal marker

Code

File

What

me.contract L86-92

other identity rows with the delete swipe action

me.contract L125-130

Remove this identity? dialog on Me

me.contract L212-214

Remove from this device row

me.contract L228-233

Remove this identity? dialog on Identity detail

app.contract L215

meAimed

app.contract L225

meRemoved refreshes meIds then meAfterRemove

app.contract L605-622

meAskRemove, meRemove, meAfterRemove

src/me/sources.ts L100-106

meRemoveIdentity

src/identity/index.ts L124-131

removeKey

src/identity/index.ts L67-87

loadRemovedKeys and write: the removal marker

src/vault/store.ts L171-226

reconcile: a marker becomes a deletion, an absent key does not

Tests

File

What it checks

me.test.contract

me: import a phrase, import a key file, switch, remove after asking

me.test.contract

me: identity detail exports the key file after asking, and removes

src/me/__tests__/sources.test.ts

removal keeps a valid current identity or selects the oldest remaining identity

src/identity/__tests__/identity.test.ts

seed-keys store: save, list, sign, remove

src/vault/__tests__/vault.test.ts

rename and deletion in Me synchronize with a tombstone

src/vault/__tests__/vault.test.ts

only a removal made in Me leaves a marker, and the marker is spent once the vault records it

.tests/real-vault/real-vault.test.ts

phone add, rename and remove reach the server and the web vault

Delivery

Delivered by #1470.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Comments