Skip to content

Proposal: Use comments for instructions#35

Open
Yuki-YuXin wants to merge 11 commits into
mainfrom
yuki/bug-bash-fix
Open

Proposal: Use comments for instructions#35
Yuki-YuXin wants to merge 11 commits into
mainfrom
yuki/bug-bash-fix

Conversation

@Yuki-YuXin

@Yuki-YuXin Yuki-YuXin commented Oct 18, 2024

Copy link
Copy Markdown
Contributor

Propose to use comment to provide extra instructions for developers on how to deal with unexpected SDK results.

@Yuki-YuXin Yuki-YuXin changed the title [Bug bash] Android - Sample App doesn't show any message when trying to login with account using MFA Bug bash fixing Oct 18, 2024
handleSignUpError(actionResult)
}
is SignUpResult.AttributesRequired -> {
// AttributesRequired only happens after CodeRequired. Please refer to the SignUpCodeFragment for more information.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are we adding this comment? What are we trying to clarify?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Giving developers some hint that why SignUpResult.AttributesRequired is an unexpected_sdk_result in this case. Currently there is no place like documentation teach developers about this.

}
is SignUpResult.AttributesRequired,
is SignUpResult.PasswordRequired -> {
// AttributesRequired and PasswordRequired only happens after CodeRequired. Please refer to the SignUpCodeFragment for more information.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This block is for Password required and Attributes required result. I don't think this comment applies

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

According to my experience of doing the release test cases, AttributesRequired and PasswordRequired only happens after CodeRequired. Thus, they are unexpected_sdk_result

handleSignInError(actionResult)
}
else -> {
// Please refer to other sign in fragments for the handling of other possible results.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd just say:

Suggested change
// Please refer to other sign in fragments for the handling of other possible results.
// Unexpected result

As you did in other else sections

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The comment here guide developer the route and instructions when they meet unexpected_sdk_result

)
} else {
displayDialog(getString(R.string.unexpected_sdk_result_title), actionResult.toString())
// Please refer to other sign in fragments for the handling of other possible results.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as others "else" block:

Suggested change
// Please refer to other sign in fragments for the handling of other possible results.
// Unexpected result

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The comment here guide developer the route and instructions when they meet unexpected_sdk_result

displayDialog(getString(R.string.unexpected_sdk_result_title), actionResult.toString())
}
is SignUpResult.PasswordRequired -> {
// Please double-check the user flow settings of the application (client id) to make sure it's email + otp.

@nilo-ms nilo-ms Nov 20, 2024

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Similar comment applies here too:

Suggested change
// Please double-check the user flow settings of the application (client id) to make sure it's email + otp.
// Please refer to the EmailPasswordSignInSignUpFragment for handling sign up with password.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would insist on the original one because "Please refer to the EmailPasswordSignInSignUpFragment for handling sign up with password." cannot help developers to understand why SignUpResult.PasswordRequired is unexpected_sdk_result in this case.

}
is SignUpResult.AttributesRequired,
is SignUpResult.AttributesRequired -> {
// Please double-check the user flow settings to ensure that the user flow is not set to collect the required attributes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest using the same comment structure here:

Suggested change
// Please double-check the user flow settings to ensure that the user flow is not set to collect the required attributes.
// Please refer to the EmailAttributesSignUpFragment for handling sign up with attributes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The two mean different things.

In this case, we don't include the scenario of collecting attributes in different UI screens. That's the reason why SignUpResult.AttributesRequired is unexpected_sdk_result. It could be valid.

EmailAttributesSignUpFragment is for collecting things in the same UI screens.

Yuki-YuXin and others added 4 commits November 20, 2024 15:12
…sampleapp/AccessApiFragment.kt

Co-authored-by: Danilo Raspa <105228698+nilo-ms@users.noreply.github.com>
…sampleapp/EmailPasswordSignInSignUpFragment.kt

Co-authored-by: Danilo Raspa <105228698+nilo-ms@users.noreply.github.com>
…sampleapp/EmailSignInSignUpFragment.kt

Co-authored-by: Danilo Raspa <105228698+nilo-ms@users.noreply.github.com>
…sampleapp/EmailSignInSignUpFragment.kt

Co-authored-by: Danilo Raspa <105228698+nilo-ms@users.noreply.github.com>
@spetrescu84

Copy link
Copy Markdown
Contributor

Imo this PR should only handle:
Additional Bug: Display Error Dialog Empty Content as the other PR handles the other 2, or do I miss understand?

)
}
is SignInResult.PasswordRequired -> {
// Please double-check the type(email+password/email+otp) of email you provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Can this be properly formatted? Same spacing.

@Yuki-YuXin Yuki-YuXin changed the title Bug bash fixing Proposal: Use comments for instructions Nov 26, 2024
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.

3 participants