-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
fix(user-profile): enable saving empty bio to clear user profile field #33927
base: develop
Are you sure you want to change the base?
Conversation
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 0ad5656 The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…e handling - Added a test case to ensure the bio field is correctly set to an empty string. - Updated user identity handling to support clearing the bio field.
apps/meteor/app/lib/server/functions/getAvatarSuggestionForUser.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be api test for this.
Hi @debdutdeb and @Gustrb, |
Hey, I agree with @debdutdeb we should have an API test for this as well |
- Added a check in the saveUserIdentity test suite to confirm that the setBio function is invoked when a user sets their bio to an empty string. - Introduced a stubbed function for setBio to monitor its invocation during the test. - Ensures proper behavior and validation of bio updates, including empty values.
5f9ce92
to
f3f9c69
Compare
- Added a test to validate that the saveUserProfile API correctly handles setting the bio field to an empty string. - Included validation to ensure bio updates persist correctly when cleared. - Verified compliance with bio length constraints and ensured no errors occur for empty input.
Hi @Gustrb , I’ve added API tests for setting an empty bio field in the user profile. These tests include:
To the best of my knowledge, these cover the requested scenarios. Could you please review and let me know if they align with the tests you asked about? If not, I’d appreciate it if you could clarify which specific API tests are referred to here so I can address them. Thank you! |
Hey @Curious-Goblin no need to keep merging develop into your branch, you're good. |
ok, I will take care of it next time |
- Added a new test file to check the behavior when updating a user's bio to an empty field. - Altered .mocharc.js configuration to include the new test file for execution. - The update is still a work in progress and may need further adjustments.
Based on feedback, the saveUserProfile.spec.ts test file is not required. The path added to .mocharc.js for running this test has also been removed. These changes align with the confirmation that unit tests for saveUserProfile are unnecessary, as the current API tests are sufficient.
Hi @Gustrb, I hope you're doing well! It's been a while since my last commit. I wanted to ask if you've had a chance to discuss it with the QA team. If there are any errors or improvements needed, please let me know—I’d be happy to address them promptly. Thanks for your time and guidance! |
Hi @Gustrb , |
Asking Gustavo to check. He had some other pressing items and had to delay this for a bit |
Please note. Nothing around here happens fast. It can take MONTHS. There have also been the Christmas holidays which for many is up to two weeks and has only just finished. It is with the team. You just have to be extremely patient. |
Hey, we don't merge PR's with failing tests, please fix that, then I will look into QA-ing |
regarding the failing tests thought that these tests which are failing I did not think that they were not the results on my changes but I will now look into my pr and try to change things accordingly so that the tests not fail |
The UI tests are not, but there is one API test that is: |
I want to ask that if empty bio and null bio are the same thing or not because this PR is solely made for one to save their bio as empty, and if the empty bio == null then the test which is rejecting null bio should fail in order to achieve the required feature |
@@ -79,7 +79,7 @@ async function saveUserProfile( | |||
await setUserStatusMethod(this.userId, settings.statusType as UserStatus, undefined); | |||
} | |||
|
|||
if (user && settings.bio) { | |||
if (user && settings.bio !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that if you change this to != it will work. let javascript coerce null to undefined
(empty string does not coerce to undefined)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will apply these changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please re run the workflows so that we can see the tests are still failing or not ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please give the approval to run the workflows ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please run the tests once again to see whether the tests are failing of not
I think that now this error should be resolved now, can you check on it please |
the api tests are still failing |
how can I see this message in the workflows I am not able find it out, can you help me ? and I have tried running the test locally but for some reason I am not able to up the temporary mongo database due to which i am not able to run e2e tests and therefore I am asking you to give the approval for running the workflows |
9b8785e
to
f6ccc36
Compare
to run the api tests (the ones that are failing you can do the following:
Note: only run the tests when the workspace is up and running |
Thank you very much for this guidance, I have now checked that the test which you told about, is passing successfully. Actually the problem was in the test, it was sending request to wrong api endpoint, upon fixing that the test passed without changing anything the saveUserProfile file. Please give the approval to the workflows and see if anything more is required to be worked on. |
can you please give the approval to run the workflows ?? |
Please read the link above:
The answer will be no because only rocket devs have permissions to do this. Please stop asking. Thanks. |
Gustrb has given the approvals for workflows for a several times and therefore I was asking to him so that we can move forward with the PR |
Ok. In which case you may need to be patient - many of the main devs do not work on the weekend. |
ok |
Hello gustrb, I request you to give the approval for running the workflows as on my system the test passed |
Please, remove the changes in yarn.lock |
I have reverted the changes in yarn.lock can you now see it |
Proposed changes
This pull request enables the ability to save an empty bio in the user profile to clear out the bio field, which was previously uneditable if left empty.
Issue(s)
Steps to test or reproduce
Checklist