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

Fix unresponsive soft-logout in the legacy flow. #6329

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

pixlwave
Copy link
Member

Closes #5881 (the crash was already fixed as part of #6257) by making sure that splash screen/use case screen is presented after choosing to delete all data when using the old auth flow. This is done by

  • Delegating logic to the OnboardingCoordinator like the new flow does.
  • Reseting the credentials on every presentation of authVC.
  • Making sure not to set the credentials again after deleting the data (the new soft logout screen was being shown twice).

- Delegate logic to the OnboardingCoordinator like the new flow does.
- Reset the credentials on every presentation of authVC.
- Make sure not to set the credentials after deleting the data.
Comment on lines 268 to 274
self.showClearAllDataConfirmation {
MXLog.debug("[OnboardingCoordinator] showLegacyAuthenticationScreen: Clear all data after soft logout")
self.authenticationService.reset()
self.authenticationFinished = false
self.cancelAuthentication(flow: .login)
AppDelegate.theDelegate().logoutSendingRequestServer(true, completion: nil)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the same code as used in the callback from the new flow. @ismailgulek, I was wondering if it would make sense to remove the completion closure and place that code directly in the method to avoid duplication. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah makes sense to me 👍

@@ -606,9 +614,9 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
message: VectorL10n.authSoftlogoutClearDataSignOutMsg,
preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: VectorL10n.cancel, style: .cancel, handler: nil))
alertController.addAction(UIAlertAction(title: VectorL10n.authSoftlogoutClearDataSignOut, style: .default, handler: { action in
alertController.addAction(UIAlertAction(title: VectorL10n.authSoftlogoutClearDataSignOut, style: .destructive) { action in
Copy link
Contributor

Choose a reason for hiding this comment

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

🤩

Copy link
Contributor

@ismailgulek ismailgulek left a comment

Choose a reason for hiding this comment

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

LGTM!

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@pixlwave pixlwave merged commit 7c81f67 into develop Jun 21, 2022
@pixlwave pixlwave deleted the doug/5881-soft-logout branch June 21, 2022 16:30
stefanceriu pushed a commit that referenced this pull request Jun 28, 2022
- Delegate logic to the OnboardingCoordinator like the new flow does.
- Reset the credentials on every presentation of authVC.
- Make sure not to set the credentials after deleting the data.
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.

Tapping the Clear all data button on soft logout screen crashes the app.
2 participants