Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(applock): forgot passcode - reset device [WPB-5094] #2392

Merged
merged 17 commits into from Nov 7, 2023

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Nov 6, 2023

TaskWPB-5094 [Android] Reset passcode if user forgets


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

When the user forgets the passcode, there needs to be an option to reset it by clearing the whole device.

Solutions

Create new screen that launches when the user clicks on "forgot your passcode?". After clicking on "reset device", the user is asked to enter the password, the app then uses this password and verifies it by executing client removal and if it's successful, then the app makes a hard-logout of all accounts.

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Set the applock, kill the app, open again and click on "forgot your passcode?".

Attachments (Optional)

forgot_passlock_reset.mp4

PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Test Results

674 tests  +11   674 ✔️ +11   9m 3s ⏱️ + 1m 42s
  98 suites +  1       0 💤 ±  0 
  98 files   +  1       0 ±  0 

Results for commit 0dd15ab. ± Comparison against base commit 727c6cf.

This pull request removes 2 and adds 13 tests. Note that renamed tests count towards both.
com.wire.android.ui.home.appLock.SetLockScreenViewModelTest ‑ given new password input, when invalid,then should update state()
com.wire.android.ui.home.appLock.SetLockScreenViewModelTest ‑ given new password input, when valid,then should update state()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given deleting client returns failure, when deleting current client, then return failure()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given deleting client returns invalid credentials, when deleting current client, then return InvalidPassword()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given deleting client returns success, when deleting current client, then return Success()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given no sessions, when logging out, then make all required actions other than logout and return success()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given no valid sessions, when logging out, then make all required actions other than logout and return success()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given password not required, when validating password, then return Success()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given password required and valid, when validating password, then return Success()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given password required but invalid, when validating password, then return InvalidPassword()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given password required returns failure, when validating password, then return failure()
com.wire.android.ui.home.appLock.forgot.ForgotLockScreenViewModelTest ‑ given sessions return failure, when hard-logging out sessions, then return failure()
…

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Merging #2392 (0dd15ab) into develop (727c6cf) will decrease coverage by 0.03%.
The diff coverage is 19.44%.

@@              Coverage Diff              @@
##             develop    #2392      +/-   ##
=============================================
- Coverage      41.60%   41.57%   -0.03%     
- Complexity      1077     1078       +1     
=============================================
  Files            343      344       +1     
  Lines          12271    12292      +21     
  Branches        1612     1615       +3     
=============================================
+ Hits            5105     5111       +6     
- Misses          6685     6699      +14     
- Partials         481      482       +1     
Files Coverage Δ
...ndroid/ui/home/appLock/set/SetLockCodeViewState.kt 100.00% <ø> (ø)
...appLock/unlock/AppUnlockWithBiometricsViewModel.kt 0.00% <ø> (ø)
...d/ui/home/appLock/unlock/EnterLockCodeViewState.kt 0.00% <ø> (ø)
...n/com/wire/android/feature/AccountSwitchUseCase.kt 64.93% <50.00%> (-1.74%) ⬇️
.../ui/home/appLock/forgot/ForgotLockCodeViewState.kt 46.15% <46.15%> (ø)
...main/kotlin/com/wire/android/ui/AppLockActivity.kt 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 727c6cf...0dd15ab. Read the comment docs.

Copy link
Contributor

github-actions bot commented Nov 6, 2023

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 1651 succeeded.

The build produced the following APK's:

Copy link
Contributor

@vitorhugods vitorhugods left a comment

Choose a reason for hiding this comment

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

Tidy

@saleniuk saleniuk requested review from a team, typfel, yamilmedina, alexandreferris and Garzas and removed request for a team November 6, 2023 12:07
@saleniuk saleniuk added this pull request to the merge queue Nov 7, 2023
Merged via the queue into develop with commit 162eded Nov 7, 2023
15 checks passed
@saleniuk saleniuk deleted the feat/applock-forgot-passcode branch November 7, 2023 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants