Skip to content

Conversation

@ShankhanilSaha
Copy link
Collaborator

Explanation

Fixes #5972

  • Updates utility/src/main/java/org/oppia/android/util/profile/ProfileNameValidator.kt to only allow names which have only alphabets and spaces.
  • Now names with single dots(.) and single spaces( ) are not allowed anymore which previously were.

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

@ShankhanilSaha ShankhanilSaha requested a review from a team as a code owner November 3, 2025 14:34
Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

Thanks @ShankhanilSaha! I have reviewed the PR and left some comments. Also, please take a look at the CI results -- tests in ProfileManagementControllerTest are failing due to the changed logic. Please locate the failing tests and either fix them, or verify whether the new logic is working correctly.

Please also reach out if you have any questions.

@ShankhanilSaha
Copy link
Collaborator Author

ShankhanilSaha commented Nov 5, 2025

Hi @adhiamboperes, the tests are primarily failing because of the tests in utility/src/test/java/org/oppia/android/util/profile/ProfileNameValidatorTest.kt
should i completely remove the tests which are verifying names which were formerly allowed? or should i update them to something like the code in the attatchment which will expect false to formerly allowed names.
Screenshot_20251105_230528

@ShankhanilSaha ShankhanilSaha deleted the profile-name-verifier branch November 6, 2025 14:06
@ShankhanilSaha ShankhanilSaha restored the profile-name-verifier branch November 6, 2025 14:06
@ShankhanilSaha ShankhanilSaha reopened this Nov 6, 2025
@ShankhanilSaha
Copy link
Collaborator Author

@adhiamboperes could you please check the error logs once, some tests were failing previously so i fixed them by changing the functions to addAdminProfileAndWait() which fixed the issue of the test looking for a profile before it was even created.
But now it seems like there is some maven related dependency downloading issue which i believe has not arrived from my code, could be wrong.

@theMr17
Copy link
Collaborator

theMr17 commented Nov 13, 2025

@ShankhanilSaha I've re-run the tests, they should work fine now.

@ShankhanilSaha
Copy link
Collaborator Author

@adhiamboperes upon making the file changes in this PR a few tests fail in app/src/sharedTest/java/org/oppia/android/app/onboarding/CreateProfileFragmentTest.kt
and
testing/src/test/java/org/oppia/android/testing/profile/ProfileTestHelperTest.kt even tho tests are unrelated to the changes since they don't use any name which passed previously but gets rejected with the changes. I could use some help with this one.

@adhiamboperes
Copy link
Collaborator

Hi @ShankhanilSaha, those tests are failing because they rely on the ProfileManagementController, which relies on the ProfileNameValidator

@adhiamboperes
Copy link
Collaborator

Looking at the traces, it appears that the failing functions rely on an exception that has changed, so there are changes needed downstream as well. I need to review the code first.

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.

[Validation Issue]: Profile name accepts invalid inputs like single dot (.) or single space ( )

3 participants