Repository navigation
chore(runway): cherry-pick feat(kyc): delete identity data from security settings - #39742
Conversation
…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> <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> </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>
|
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. |
Smart E2E Test SelectionSelected E2E tagsSmokeSeedlessOnboarding AI Confidence: 88 E2E reasoningExpand to readThe PR adds a new DeleteIdentityData section to the Security & Privacy settings screen, plus a test ID constant and new |
|



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-controller0.15.0 and theKycService:createDeletionand
KycService:completeDeletionmessenger actions. Cancelling theconfirmation 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
Screenshots/Recordings
Before
N/A
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
SRPs
to import wallets with many accounts and tokens
performance metrics
trace()for usage andaddTokenfor an example
For performance guidelines and tooling, see the Performance
Guide.
Pre-merge reviewer checklist
app, test code being changed).
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 thatverification token. That requires
@metamask/kyc-controller0.16.0 andthe
KycService:createDeletionandKycService:completeDeletionmessenger 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
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
SRPs
to import wallets with many accounts and tokens
performance metrics
trace()for usage andaddTokenfor an example
For performance guidelines and tooling, see the Performance
Guide.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
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