Skip to content

#8917 Fix "Cannot find secrets in storage" error on Reset Everything#9128

Merged
bmarty merged 2 commits into
element-hq:developfrom
christianrowlands:bugfix/cr/reset-secret-storage
Apr 13, 2026
Merged

#8917 Fix "Cannot find secrets in storage" error on Reset Everything#9128
bmarty merged 2 commits into
element-hq:developfrom
christianrowlands:bugfix/cr/reset-secret-storage

Conversation

@christianrowlands

@christianrowlands christianrowlands commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Skip the SSSS integrity check when the user is in the "Reset everything" flow. The integrity check at SharedSecureStorageViewModel init validates that secrets exist in storage before proceeding but the "Reset everything" flow is specifically for when the user has lost access to their secrets. This creates a state where the reset fails because the very secrets the user wants to reset cannot be found.

The fix adds the same ResetAll step guard that already exists below for the key lookup (line 109), making the two checks consistent.

Motivation and context

Here is the issue this is fixing: #8917

Tests

  • Step 1: Fresh account or account without SSSS setup
  • Step 2: Trigger self-verification flow
  • Step 3: Tap "Forgot or lost all recovery options? Reset everything"
  • Step 4: Verify the reset confirmation screen appears instead of the error dialog

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 16

Checklist

Signed-off-by: Christian Rowlands <craxiomdev [at] gmail.com>

@christianrowlands

Copy link
Copy Markdown
Contributor Author

@bmarty , I have another bugfix PR for you if you have some time to review it. It is a one line fix, so hopefully an easy review.

@bmarty bmarty requested a review from BillCarsonFr March 31, 2026 15:26
@BillCarsonFr BillCarsonFr self-assigned this Mar 31, 2026
@BillCarsonFr

Copy link
Copy Markdown
Member

@christianrowlands Can you create a test in SharedSecureStorageViewModelTest ?
To reproduce the problem and show that the fix is working?

@CLAassistant

CLAassistant commented Mar 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@christianrowlands

Copy link
Copy Markdown
Contributor Author

@BillCarsonFr , yep, I can do that. I added the test.

@BillCarsonFr BillCarsonFr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmarty This is probably fixing the issue but I think there is a design problem.
It was introduced by #7721

The steps were initialy internal states, starting from a known point. It was triggering async things in the view model constructor.
Now the steps has been moved outside as a configurable thing. That's why there is this strange mix of step and requestType

Looks like we probably should have left the step as an internal thing and introduce a new RequestType. Or instead the SelfVerification Bottomsheet should directly call the navigator.open4SSetup(HARD_RESET)

... We won't probably spend time doing that

@bmarty bmarty merged commit 8ea4134 into element-hq:develop Apr 13, 2026
11 of 14 checks passed
@christianrowlands christianrowlands deleted the bugfix/cr/reset-secret-storage branch April 13, 2026 15:38
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.

4 participants