fix(user-profile): enable saving empty bio to clear user profile field
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.
- This fix addresses an issue where users could not save changes if they attempted to clear their bio.
- Implements validation adjustments to allow empty strings in the bio field.
Issue(s)
- Fixes #33783
Steps to test or reproduce
- Navigate to the user profile section in the Rocket.Chat application.
- Attempt to clear the bio field and save changes.
- Confirm that the profile successfully updates with an empty bio field.
Checklist
- [x] I have read the Contributing Guide.
- [x] I have signed the CLA.
- [x] Lint and unit tests pass locally.
- [x] Added tests to verify this fix.
- [x] Updated documentation as needed.
Looks like this PR is not ready to merge, because of the following issues:
- This PR is missing the 'stat: QA assured' label
- This PR is missing the required milestone or project
Please fix the issues and try again
If you have any trouble, please check the PR guidelines
🦋 Changeset detected
Latest commit: 0ad565636303087c9cb026b3991deb45c681f4d5
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 35 packages
| Name | Type |
|---|---|
| @rocket.chat/meteor | Patch |
| @rocket.chat/core-typings | Patch |
| @rocket.chat/rest-typings | Patch |
| @rocket.chat/uikit-playground | Patch |
| @rocket.chat/api-client | Patch |
| @rocket.chat/apps | Patch |
| @rocket.chat/core-services | Patch |
| @rocket.chat/cron | Patch |
| @rocket.chat/ddp-client | Patch |
| @rocket.chat/freeswitch | Patch |
| @rocket.chat/fuselage-ui-kit | Patch |
| @rocket.chat/gazzodown | Patch |
| @rocket.chat/livechat | Patch |
| @rocket.chat/model-typings | Patch |
| @rocket.chat/ui-contexts | Patch |
| @rocket.chat/account-service | Patch |
| @rocket.chat/authorization-service | Patch |
| @rocket.chat/ddp-streamer | Patch |
| @rocket.chat/omnichannel-transcript | Patch |
| @rocket.chat/presence-service | Patch |
| @rocket.chat/queue-worker | Patch |
| @rocket.chat/stream-hub-service | Patch |
| @rocket.chat/license | Patch |
| @rocket.chat/omnichannel-services | Patch |
| @rocket.chat/pdf-worker | Patch |
| @rocket.chat/presence | Patch |
| rocketchat-services | Patch |
| @rocket.chat/network-broker | Patch |
| @rocket.chat/models | Patch |
| @rocket.chat/ui-avatar | Patch |
| @rocket.chat/ui-client | Patch |
| @rocket.chat/ui-video-conf | Patch |
| @rocket.chat/ui-voip | Patch |
| @rocket.chat/web-ui-registration | Patch |
| @rocket.chat/instance-status | Patch |
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
Hi @debdutdeb and @Gustrb, I’ve addressed all requested changes and have added the necessary tests. Could you please review the updates when you have time? Let me know if there’s anything else needed. Thank you!
Hey, I agree with @debdutdeb we should have an API test for this as well
Hey, I agree with @debdutdeb we should have an API test for this as well
Hey, I agree with @debdutdeb we should have an API test for this as well
Hi @Gustrb ,
I’ve added API tests for setting an empty bio field in the user profile. These tests include:
- Validating that the saveUserProfile method allows clearing the bio by setting it to an empty string (bio: ' ').
- Ensuring compliance with the bio length constraints while verifying the behavior for an empty bio input.
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. Let's run the CI to see, but looks good to me
Hey @Curious-Goblin no need to keep merging develop into your branch, you're good. Let's run the CI to see, but looks good to me
ok, I will take care of it next time
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 , I wanted to follow up on this PR since it's been over a week without a response. Please let me know if any further changes or clarifications are needed from my side to move this forward. I’m happy to address any feedback
Asking Gustavo to check. He had some other pressing items and had to delay this for a bit
hello @Gustrb @casalsgh, its been another week, can someone please look into this pr and see if it is good to be merged or please help to get this pr a QA assured tag so that it can be merged or if is has some issues then let me know, I would be more than happy to contribute.
hello @Gustrb @casalsgh, its been another week, can someone please look into this pr and see if it is good to be merged or please help to get this pr a QA assured tag so that it can be merged or if is has some issues then let me know, I would be more than happy to contribute.
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:
should reject invalid bio values (e.g., null):
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
The UI tests are not, but there is one API test that is:
should reject invalid bio values (e.g., null):
I think that now this error should be resolved now, can you check on it please
the api tests are still failing
The UI tests are not, but there is one API test that is:
should reject invalid bio values (e.g., null):
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
to run the api tests (the ones that are failing you can do the following:
- Open two terminals, I'll call them A and B
- On terminal A: navigate to the RC folder and run:
TEST_MODE=true yarn dsv - On terminal B: navigate to the RC folder and run
yarn testapi
Note: only run the tests when the workspace is up and running
to run the api tests (the ones that are failing you can do the following:
* Open two terminals, I'll call them A and B * On terminal A: navigate to the RC folder and run: `TEST_MODE=true yarn dsv` * On terminal B: navigate to the RC folder and run `yarn testapi`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 ??
can you please give the approval to run the workflows ??
This workflow requires approval from a maintainer. <<<<<<<<<<<<<<
Please read the link above: Learn more about approving workflows.
Approving workflow runs from public forks When an outside contributor submits a pull request to a public repository, a maintainer with write access may need to approve some workflow runs.
The answer will be no because only rocket devs have permissions to do this. Please stop asking. Thanks.
can you please give the approval to run the workflows ??
This workflow requires approval from a maintainer. <<<<<<<<<<<<<<
Please read the link above: Learn more about approving workflows.
Approving workflow runs from public forks When an outside contributor submits a pull request to a public repository, a maintainer with write access may need to approve some workflow runs.
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
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
to run the api tests (the ones that are failing you can do the following:
* Open two terminals, I'll call them A and B * On terminal A: navigate to the RC folder and run: `TEST_MODE=true yarn dsv` * On terminal B: navigate to the RC folder and run `yarn testapi`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.
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 deleted the changes in the file.
But I made those changes in order to run the test which was written by me, I ran different commands written in the script but got that dependencies are missing like the one in the ss
To overcome I installed required some dependencies locally and globally and then I reached this command
TS_NODE_COMPILER_OPTIONS='{"module": "commonjs"}' yarn mocha tests/end-to-end/api/users.ts --config .mocharc.api.js which successfully ran my test but now as I reverted the changes to original this shows this error
Maybe I am wrong, I don't know the proper way to run my test.
I was doing as you directed but got some errors
Please, remove the changes in yarn.lock
I have reverted the changes in yarn.lock can you now see it