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

Encryption Flow Coordinators. #3471

Merged
merged 4 commits into from
Nov 4, 2024
Merged

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Nov 1, 2024

This PR is the next part needed for #3399:

The whole SecureBackup…/EncryptionReset… flow was intertwined, using the screen coordinators to perform navigation, manipulating the stack, and including some duplication between the Settings flow and the Onboarding flow. This PR makes the following changes:

  • Build an EncryptionSettingsFlowCoordinator and a EncryptionResetFlowCoordinator which take all navigation responsibility away from the screens. They're based on state machines which now I'm done I realise is a bit overkill given by the end of the refactor they're both very simple, however now that those are in place it seems better to leave them for the future than remove them (e.g. EncryptionSettingsFlowCoordinator is going to get another section that I think is going to involve a bit more complex set up).
  • Remove the reset flow from EncryptionSettingsFlowCoordinator as it turns out the view action for this was removed in Tweak the UI in the EncryptionReset, IdentityConfirmation and SecureBackupRecovery screens. #3391, but the view model upwards was left in place 🤦‍♂️
  • Add UI tests for both flows to ensure presentation works as expected.

Sorry this grew so large, I can now see how it could have been split into 2 smaller PRs but that wasn't apparent until most of the refactor was done. It is split into reviewable commits though.

@pixlwave pixlwave requested a review from a team as a code owner November 1, 2024 15:47
@pixlwave pixlwave requested review from Velin92 and removed request for a team November 1, 2024 15:47
@pixlwave pixlwave added the pr-misc for other changes label Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against 9092350

Copy link

sonarcloud bot commented Nov 1, 2024

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 9.03427% with 292 lines in your changes missing coverage. Please review.

Project coverage is 77.72%. Comparing base (1f90f1a) to head (9092350).
Report is 3 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ordinators/EncryptionSettingsFlowCoordinator.swift 0.00% 126 Missing ⚠️
...wCoordinators/EncryptionResetFlowCoordinator.swift 0.00% 93 Missing ⚠️
...s/FlowCoordinators/OnboardingFlowCoordinator.swift 0.00% 15 Missing ⚠️
...een/SecureBackupRecoveryKeyScreenCoordinator.swift 0.00% 14 Missing ⚠️
...ces/FlowCoordinators/SettingsFlowCoordinator.swift 0.00% 13 Missing ⚠️
...onResetScreen/EncryptionResetScreenViewModel.swift 0.00% 8 Missing ⚠️
...reBackupScreen/SecureBackupScreenCoordinator.swift 0.00% 4 Missing ⚠️
...een/EncryptionResetPasswordScreenCoordinator.swift 0.00% 3 Missing ⚠️
...creen/EncryptionResetPasswordScreenViewModel.swift 50.00% 3 Missing ⚠️
...creen/SecureBackupRecoveryKeyScreenViewModel.swift 0.00% 3 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3471      +/-   ##
===========================================
- Coverage    77.90%   77.72%   -0.18%     
===========================================
  Files          744      745       +1     
  Lines        61427    61564     +137     
===========================================
- Hits         47853    47851       -2     
- Misses       13574    13713     +139     
Flag Coverage Δ
unittests 69.43% <9.03%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pixlwave pixlwave merged commit 8e26718 into develop Nov 4, 2024
13 checks passed
@pixlwave pixlwave deleted the doug/recovery-flow-coordinator branch November 4, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-misc for other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants