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

Feature: Auth Ready, resolves IBM/unity-sdk-core#32 #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Esam-Bustaty
Copy link
Contributor

Added Authenticator.IsDoneInitializing field so

while (!service.Authenticator.CanAuthenticate())
    yield return null;

can become:

while (!service.Authenticator.IsDoneInitializing)
    yield return null;

if (!service.Authenticator.CanAuthenticate())
{
    // authentication failed
}
else
{
    // authentication succeeded
}

@Esam-Bustaty Esam-Bustaty changed the title Feature: Auth Ready, Solve #32 Feature: Auth Ready Jun 9, 2020
@Esam-Bustaty Esam-Bustaty changed the title Feature: Auth Ready Feature: Auth Ready, resolves #32 Jun 9, 2020
@Esam-Bustaty Esam-Bustaty changed the title Feature: Auth Ready, resolves #32 Feature: Auth Ready, resolves IBM/unity-sdk-core#32 Jun 9, 2020
Copy link
Member

@mamoonraja mamoonraja left a comment

Choose a reason for hiding this comment

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

Left one question, overall it does look fine. I will take some time out to do some testing before approving today. Once again thanks a lot for the PR.

@@ -131,6 +134,7 @@ private void GetToken()

private void OnGetToken(DetailedResponse<CloudPakForDataTokenResponse> response, IBMError error)
{
isDoneInitializing = true;
Copy link
Member

Choose a reason for hiding this comment

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

Should isDoneInitializing be called after we throw the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, yes.

If we move the new line a few lines down (inside else statement) so it's not called when an error happens, then there would be no way left for a consumer class to know if an error happened.

If you think this is not clear enough, maybe we should have an IsWaiting field instead, it would have the opposite value to IsDoneInitializing, and maybe makes thing more clear?

Base automatically changed from master to main February 10, 2021 22:42
@mediumTaj mediumTaj requested a review from kevinkowa April 9, 2021 15:51
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