-
Notifications
You must be signed in to change notification settings - Fork 500
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
Add AuthenticationService and RegistrationWizard. #6056
Conversation
📱 Scan the QR code below to install the build for this PR. If you can't scan the QR code you can install the build via this link: https://i.diawi.com/NGGxsC |
RiotSwiftUI/Modules/Authentication/Common/AuthenticationModels.swift
Outdated
Show resolved
Hide resolved
RiotSwiftUI/Modules/Authentication/Common/HomeserverAddress.swift
Outdated
Show resolved
Hide resolved
} | ||
|
||
@available(iOS 14.0, *) | ||
class AuthenticationService: NSObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am looking at the associated future PR, but unless I missed it I cannot see any tests (whether unit or integration) for a lot of this new code (only ViewModel
s etc). Given the amount of state changes and logic contained in this code I think it would be valuable to create them where appropriate.
The class is also quite large and managing the flow of both the registration and login, which are actually flows mutually exclusive of each other. I think it might be worth breaking this down even further for better readability, testability and to prevent this from growing unmanagabley in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this reply from above as it landed on the wrong comment:
I've added some basic tests for against the service for now. Currently integration but would like to mock the HTTP/REST clients once I've finished the registration flow. Will add tests for the RegistrationWizard at this point too.
RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/RegistrationWizard.swift
Outdated
Show resolved
Hide resolved
RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/RegistrationWizard.swift
Show resolved
Hide resolved
RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/RegistrationWizard.swift
Outdated
Show resolved
Hide resolved
RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/ThreePIDModels.swift
Outdated
Show resolved
Hide resolved
Add tests for AuthenticationService.
Thanks for addressing all the comments. I realise that a lot of the flow is still a WIP so happy to unblock this PR, and refine any remaining bits in the upcoming ones. |
Thanks, sounds like a plan to me 🙌 |
This PR extracts just the service, wizard and related models from #6048 for 2 smaller PR reviews.
The Changelog will come as part of that PR.
The implementation is based on Element Android, adapting
MX
responses from the SDK into matching models and using async/await to mirror Kotlin's suspending functions.Depends on matrix-org/matrix-ios-sdk#1443