Added suggestAvailableUsername helper function (src/user/profile.js ; src/topics/create.js ; public/src/client/register.js): Suggest a unique username #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recitation 3: Software Archaeology
1. Issue
Full path to the refactored file:
src/user/profile.js
src/topics/create.js
public/src/client/register.js
What do you think this file does?
src/user/profile.js : I believe handles the back end of what the user decides to change/interact with their account/profile.
src/topics/create.js: I believe it handles with the back end of topics.
public/src/client/register.js: I believe handles the front end of when a client registers/creates a new account.
What is the scope of your refactoring within that file(s)?
I added the helper function suggestAvailableUsername so that when the taken username error pops up, there is a suggested username generated.
2. Refactoring
How did the specific issue you chose impact the codebase’s adaptability?
Having suggested available usernames ensures that all usernames are unique and helps the user experience when registering.
What changes did you make to resolve the issue?
The added helper function does not trigger, which can be a calling issue, making the change not reflected in the push. Also, an issue of changing multiple files rather than just one.
How do your changes improve adaptability? Did you consider alternatives?
The change is not in use, making it hurt the code's adaptability. Potential alternatives is to revert the code and solely change the public/src/client/register.js file.
3. Validation
How did you trigger the refactored code path from the UI?
I have yet to see the refactored code be triggered and shown in the UI.