Skip to content

Conversation

@kammari-ashritha
Copy link

@kammari-ashritha kammari-ashritha commented Jan 13, 2026

Proposed changes

Users were unable to delete their "Bio" from the profile settings. When a user cleared the input and saved, the backend attempted to $unset the field, but the UI (or data layer) retained the previous value, making it impossible to remove a bio once set.

This PR fixes the issue by updating the Users.setBio model to explicitly save the empty string "" using $set instead of removing the field with $unset. This forces the database to overwrite the value, ensuring the profile reflects the empty state correctly.

Issue(s)

Closes #33783

Steps to test or reproduce

  1. Login as any user.
  2. Go to My Account -> Profile.
  3. Set a Bio (e.g., "Hello World") and save.
  4. Clear the Bio input field (make it empty) and click Save.
  5. Refresh the page.
  6. Result: The Bio field should remain empty (previously, the old text would reappear).

Further comments

The previous implementation used logic to $unset the bio field if the string was empty. However, this caused synchronization or caching issues where the empty state was not reflected in the client. Explicitly setting the field to an empty string ($set: { bio: "" }) ensures the update is propagated correctly and solves the regression.

Summary by CodeRabbit

  • Bug Fixes

    • User profile bio now consistently saves the trimmed input, preserving empty trimmed values instead of clearing them.
  • Chores

    • Added release metadata to support a patch addressing the bio clearing issue.

✏️ Tip: You can customize this high-level summary in your review settings.

@kammari-ashritha kammari-ashritha requested a review from a team as a code owner January 13, 2026 18:22
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 13, 2026

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-bot
Copy link

changeset-bot bot commented Jan 13, 2026

🦋 Changeset detected

Latest commit: 40a3ed2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 40 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/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration 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/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core 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

@CLAassistant
Copy link

CLAassistant commented Jan 13, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

Walkthrough

Refactored Users model bio persistence: setBio now always stores the trimmed bio value via a direct $set, allowing empty strings to be saved where previously they were unset.

Changes

Cohort / File(s) Summary
Bio update logic simplification
packages/models/src/models/Users.ts
Replaced conditional unset logic with a direct $set of bio.trim(), so empty bios are persisted.
Release changeset
.changeset/popular-eagles-press.md
Added a patch changeset noting the bugfix: "Fix user profile bio not clearing when saved as empty."

Sequence Diagram(s)

(omitted — change is a small single-file logic adjustment and does not introduce multi-component control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #37430: Addresses the same bug — allowing user bio to be saved as an empty value.

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ricardogarim

Poem

🐰✨ I trimmed the leaves of a tiny line,
Now empty or full — the bio is mine.
No more previous text stubbornly clings,
A clean little field where fresh data springs.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: enabling users to save an empty bio to clear the profile field.
Linked Issues check ✅ Passed The PR directly addresses issue #33783 by modifying setBio to use $set instead of $unset, allowing empty bios to persist and clear the field as expected.
Out of Scope Changes check ✅ Passed All changes are in scope: the Users.ts model fix and changeset file are directly related to resolving the bio-clearing issue from #33783.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1d18d2e and 54fcb40.

📒 Files selected for processing (1)
  • .changeset/popular-eagles-press.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/popular-eagles-press.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@kammari-ashritha
Copy link
Author

Hi team! Just checking in on this. Since this is my first contribution, I believe the workflows need manual approval to run. Could someone please take a look? Thanks!

@dougfabris
Copy link
Member

Hi there, thanks for the contribution! 🚀 💯

Closing this PR because it's stale now and it was already fixed here #37430


Questions? Help needed? Feature Requests?

  • Join our Open Server in the #support channel and feel free to raise a question
  • Join our Community Forum and search/create a post there

@dougfabris dougfabris closed this Jan 22, 2026
@kammari-ashritha
Copy link
Author

Thanks @dougfabris! I appreciate the update. Glad to see the issue is resolved. I'll look for other open issues to contribute to.

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.

Cannot Set Bio to Empty

3 participants