Skip to content

chore(runway): cherry-pick feat(kyc): delete identity data from security settings - #39742

Merged
sleepytanya merged 1 commit into
release/8.21.0from
runway-cherry-pick-8.21.0-1794596223
Nov 13, 2026
Merged

sleepytanya merged 1 commit into
release/8.21.0from
runway-cherry-pick-8.21.0-1794596223

Conversation

@runway-github

@runway-github runway-github Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Description

Customers who have started identity verification can delete the
encrypted identity data MetaMask holds from Security settings, without a
separate screen.

The section appears only when the money-account flag is on and a KYC
session exists. Confirming calls
KycController.deleteEncryptedStorage(). That requires
@metamask/kyc-controller 0.15.0 and the KycService:createDeletion
and KycService:completeDeletion messenger actions. Cancelling the
confirmation leaves the data in place.

Performance checks do not apply: this is a static settings section with
no lists, polling, or animation. It has not been exercised on a device
yet.

Changelog

CHANGELOG entry: Added a Security settings control to delete encrypted
identity verification data.

Related issues

Fixes:

Refs: #38381

Manual testing steps

Feature: delete identity data from Security settings

  Scenario: the section stays hidden until verification has started
    Given the money-account feature flag is off or there is no KYC session
    When I open Security settings
    Then I do not see "Delete Identity Data"

  Scenario: confirming deletes the encrypted identity data
    Given the money-account feature flag is on and a KYC session exists
    When I open Security settings
    And I tap "Delete identity data"
    And I confirm "This cannot be undone."
    Then the app deletes the encrypted identity data and reports success

  Scenario: cancelling leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and then cancel
    Then nothing is deleted

Screenshots/Recordings

Before

N/A

After

Screenshot 2026-11-06 at 12 54 42 PM
Screenshot 2026-11-06 at 12 54 50 PM
Screenshot 2026-11-06 at 12 54 24 PM

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
  • Use these power-user
    SRPs

    to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production
    performance metrics
  • See trace() for usage and
    addToken
    for an example

For performance guidelines and tooling, see the Performance
Guide
.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Description

Customers who have started identity verification can delete the
encrypted identity data MetaMask holds from Security settings, without a
separate screen.

The section appears only when the money-account flag is on and a KYC
session exists. Confirming asks for an email one-time code, then calls
KycController.deleteEncryptedStorage({ aal2Token }) with that
verification token. That requires @metamask/kyc-controller 0.16.0 and
the KycService:createDeletion and KycService:completeDeletion
messenger actions. Cancelling the confirmation, or backing out of the
email check, leaves the data in place.

Performance checks do not apply: this is a static settings section with
no lists, polling, or animation. It has not been exercised on a device
yet.

Changelog

CHANGELOG entry: Added a Security settings control to delete encrypted
identity verification data.

Related issues

Fixes:

Refs: #38381

Manual testing steps

Feature: delete identity data from Security settings

  Scenario: the section stays hidden until verification has started
    Given the money-account feature flag is off or there is no KYC session
    When I open Security settings
    Then I do not see "Delete Identity Data"

  Scenario: confirming deletes the encrypted identity data
    Given the money-account feature flag is on and a KYC session exists
    When I open Security settings
    And I tap "Delete identity data"
    And I confirm "This cannot be undone."
    And I complete the email one-time code check
    Then the app deletes the encrypted identity data and reports success

  Scenario: cancelling leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and then cancel
    Then nothing is deleted

  Scenario: backing out of email verification leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and confirm
    And I back out of the email one-time code check
    Then nothing is deleted and no error is shown

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
  • Use these power-user
    SRPs

    to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production
    performance metrics
  • See trace() for usage and
    addToken
    for an example

For performance guidelines and tooling, see the Performance
Guide
.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.
Open in Web Open in Cursor 

Note

Medium Risk
Introduces user-triggered deletion of encrypted KYC data with MFA
gating; mistakes could affect identity verification state, but scope is
limited to customers with an active session and the feature flag.

Reviewed by Cursor Bugbot for commit
23be80c. Bugbot is set up for automated
code reviews on this repo. Configure
here.


Signed-off-by: Sébastien Van Eyck sebastien.vaneyck@consensys.net
Co-authored-by: Cursor cursoragent@cursor.com
Co-authored-by: Sébastien Van Eyck sebastien.vaneyck@consensys.net 3d642d6

…ity settings cp-8.21.0 (#39037)

## **Description**

<!-- mms-check: type=text required=true -->

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

Customers who have started identity verification can delete the
encrypted identity data MetaMask holds from Security settings, without a
separate screen.

The section appears only when the money-account flag is on and a KYC
session exists. Confirming calls
`KycController.deleteEncryptedStorage()`. That requires
`@metamask/kyc-controller` 0.15.0 and the `KycService:createDeletion`
and `KycService:completeDeletion` messenger actions. Cancelling the
confirmation leaves the data in place.

Performance checks do not apply: this is a static settings section with
no lists, polling, or animation. It has not been exercised on a device
yet.

## **Changelog**

<!-- mms-check: type=changelog required=true blocking=true -->

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Added a Security settings control to delete encrypted
identity verification data.

## **Related issues**

<!-- mms-check: type=issue-link required=true -->

Fixes:

Refs: #38381

## **Manual testing steps**

<!-- mms-check: type=manual-testing required=true -->

```gherkin
Feature: delete identity data from Security settings

  Scenario: the section stays hidden until verification has started
    Given the money-account feature flag is off or there is no KYC session
    When I open Security settings
    Then I do not see "Delete Identity Data"

  Scenario: confirming deletes the encrypted identity data
    Given the money-account feature flag is on and a KYC session exists
    When I open Security settings
    And I tap "Delete identity data"
    And I confirm "This cannot be undone."
    Then the app deletes the encrypted identity data and reports success

  Scenario: cancelling leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and then cancel
    Then nothing is deleted
```

## **Screenshots/Recordings**

<!-- mms-check: type=screenshot required=true -->

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

N/A

### **After**

<img width="444" height="919" alt="Screenshot 2026-11-06 at 12 54 42 PM"
src="https://github.com/user-attachments/assets/3f8afa12-1926-40ce-93d5-496623d0e8bf"
/>
<img width="443" height="895" alt="Screenshot 2026-11-06 at 12 54 50 PM"
src="https://github.com/user-attachments/assets/87c92809-76f2-44eb-ad2e-21719cb2af10"
/>
<img width="455" height="881" alt="Screenshot 2026-11-06 at 12 54 24 PM"
src="https://github.com/user-attachments/assets/2db0bb77-bbde-4617-9ed2-483cdd396a53"
/>



## **Pre-merge author checklist**

<!-- mms-check: type=checklist required=true -->

<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.

Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [x] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- Generated with the help of the pr-description AI skill -->

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## **Description**

<!-- mms-check: type=text required=true -->

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

Customers who have started identity verification can delete the
encrypted identity data MetaMask holds from Security settings, without a
separate screen.

The section appears only when the money-account flag is on and a KYC
session exists. Confirming asks for an email one-time code, then calls
`KycController.deleteEncryptedStorage({ aal2Token })` with that
verification token. That requires `@metamask/kyc-controller` 0.16.0 and
the `KycService:createDeletion` and `KycService:completeDeletion`
messenger actions. Cancelling the confirmation, or backing out of the
email check, leaves the data in place.

Performance checks do not apply: this is a static settings section with
no lists, polling, or animation. It has not been exercised on a device
yet.

## **Changelog**

<!-- mms-check: type=changelog required=true blocking=true -->

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Added a Security settings control to delete encrypted
identity verification data.

## **Related issues**

<!-- mms-check: type=issue-link required=true -->

Fixes:

Refs: #38381

## **Manual testing steps**

<!-- mms-check: type=manual-testing required=true -->

```gherkin
Feature: delete identity data from Security settings

  Scenario: the section stays hidden until verification has started
    Given the money-account feature flag is off or there is no KYC session
    When I open Security settings
    Then I do not see "Delete Identity Data"

  Scenario: confirming deletes the encrypted identity data
    Given the money-account feature flag is on and a KYC session exists
    When I open Security settings
    And I tap "Delete identity data"
    And I confirm "This cannot be undone."
    And I complete the email one-time code check
    Then the app deletes the encrypted identity data and reports success

  Scenario: cancelling leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and then cancel
    Then nothing is deleted

  Scenario: backing out of email verification leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and confirm
    And I back out of the email one-time code check
    Then nothing is deleted and no error is shown
```

## **Screenshots/Recordings**

<!-- mms-check: type=screenshot required=true -->

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

N/A

### **After**

N/A

## **Pre-merge author checklist**

<!-- mms-check: type=checklist required=true -->

<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.

Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [x] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- Generated with the help of the pr-description AI skill -->

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-6f157964-72b0-5445-87a7-0edda2664e74?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-6f157964-72b0-5445-87a7-0edda2664e74&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Introduces user-triggered deletion of encrypted KYC data with MFA
gating; mistakes could affect identity verification state, but scope is
limited to customers with an active session and the feature flag.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
23be80c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
@runway-github
runway-github Bot requested a review from a team as a code owner November 13, 2026 18:57
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamask-ci metamask-ci Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Nov 13, 2026
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags

SmokeSeedlessOnboarding
SmokeAccounts

AI Confidence: 88

E2E reasoning

Expand to read

The PR adds a new DeleteIdentityData section to the Security & Privacy settings screen, plus a test ID constant and new identity_verification locale keys. It is additive. The section returns null unless the neobankMarkets flag is non-empty and a KYC session exists, so it won't render in the default E2E fixture wallet. It is mounted after DeleteWalletData in SecuritySettings.tsx, and no existing selectors, locale strings or constants changed. The risk is limited to the shared Security & Privacy screen, which hosts the SRP reveal and export entry points covered by SmokeAccounts. Seedless wallets use the same Settings area, so I kept SmokeSeedlessOnboarding. Both tags come from the hard-rule seed. I did not add SmokeWalletPlatform, because wallet home, multi-SRP architecture and state logs are untouched. No PR review comments exist. The file-pattern grep over the tests directory failed, so I did not confirm which smoke specs import the changed files. This rests on the diffs and the tag descriptions.

View run

@sonarqubecloud

Copy link
Copy Markdown

@sleepytanya
sleepytanya merged commit 6fe15ec into release/8.21.0 Nov 13, 2026
81 checks passed
@sleepytanya
sleepytanya deleted the runway-cherry-pick-8.21.0-1794596223 branch November 13, 2026 21:47
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk:medium AI analysis: medium risk size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants