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

Add AuthenticationService and RegistrationWizard. #6056

Merged
merged 5 commits into from
Apr 27, 2022

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Apr 21, 2022

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

@pixlwave pixlwave requested a review from Anderas April 21, 2022 16:07
@github-actions
Copy link

github-actions bot commented Apr 21, 2022

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/NGGxsC

Riot/Categories/MXRestClient+Async.swift Show resolved Hide resolved
}

@available(iOS 14.0, *)
class AuthenticationService: NSObject {
Copy link
Contributor

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 ViewModels 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.

Copy link
Member Author

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.

@pixlwave pixlwave requested a review from Anderas April 27, 2022 10:24
@Anderas
Copy link
Contributor

Anderas commented Apr 27, 2022

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.

@pixlwave
Copy link
Member Author

Thanks, sounds like a plan to me 🙌

@pixlwave pixlwave merged commit 3591a3a into develop Apr 27, 2022
@pixlwave pixlwave deleted the doug/authentication_service branch April 27, 2022 15:02
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.

2 participants