Skip to content

Conversation

@dodaa08
Copy link
Contributor

@dodaa08 dodaa08 commented Jan 20, 2026

Proposed changes (including videos or screenshots)

When users cleared their bio field, it was stored as an empty string ("") in the database instead of being removed, so the UI still showed the old bio.

Screencast.From.2026-01-21.00-15-37.mp4

Updated saveUserProfile to:

  • Trim the bio value before processing

  • When the trimmed bio is empty, set unset.bio = true so notifyOnUserChange includes it in the unset payload

  • Call Users.setBio() with the empty string, which removes the field from the database

  • The client receives the unset notification and removes bio from the local user store immediately

  • Result: Clearing the bio removes it from the database and the UI updates without a refresh.

Screencast.From.2026-01-20.23-33-36.mp4

Environment

  • RC version : 8.0.1-develop
  • Browser : Brave
  • OS : fedora

Issue(s)

Fixes #33783

Steps to test or reproduce

  1. Add a non-empty bio, save, and confirm it shows in the profile and user info.
  2. Now clear the bio field completely and save again.
  3. Navigate away and back to the profile page (or reopen the profile modal).

Expected:

  1. The bio field is empty in the form.
  2. The user document no longer has a bio value, and other profile fields are unchanged.

Further comments

Hoping the approach works well for the fix, let me know if it does.

Summary by CodeRabbit

  • Bug Fixes
    • Bio input validation now trims whitespace before checking length limits, ensuring more accurate limit enforcement.
    • Whitespace-only bio entries are now properly handled during profile updates.

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

When users cleared their bio field, it remained in the database as an empty string instead of being removed. This fix ensures that empty bio values are properly unset from the database, allowing users to successfully clear their bio
@dodaa08 dodaa08 requested a review from a team as a code owner January 20, 2026 18:55
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 20, 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 20, 2026

⚠️ No Changeset found

Latest commit: 992c4d9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

Walkthrough

The pull request modifies bio handling in the user profile save method to trim input before validation. It introduces branching logic: if trimmed bio is empty, the bio field is unset; otherwise, trimmed bio is stored. Error handling now checks trimmed bio length rather than original input length.

Changes

Cohort / File(s) Summary
Bio Validation and Storage Logic
apps/meteor/server/methods/saveUserProfile.ts
Modified bio handling to trim input early and branch on whether trimmed bio is empty, affecting both validation thresholds and persistence strategy (unset flag vs. storing value)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ricardogarim
  • dougfabris

Poem

🐰 A bio trimmed with care so true,
Empty fields now bid adieu!
No phantom text shall linger here,
Just whitespace vanished, crystal clear. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: allow users to clear bio field in profile' directly describes the main change—enabling users to clear their bio field—which is the primary objective of this changeset.
Linked Issues check ✅ Passed The code changes implement all requirements from issue #33783: trimming bio input, setting unset.bio flag when empty, and calling Users.setBio() to remove the field from the database, enabling bio clearing functionality.
Out of Scope Changes check ✅ Passed All changes in saveUserProfile.ts are scoped to fixing bio field clearing; no out-of-scope modifications detected.

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

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

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

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.77%. Comparing base (78ea84f) to head (992c4d9).
⚠️ Report is 9 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38277      +/-   ##
===========================================
+ Coverage    70.75%   70.77%   +0.02%     
===========================================
  Files         3142     3142              
  Lines       108927   108930       +3     
  Branches     19632    19610      -22     
===========================================
+ Hits         77072    77100      +28     
+ Misses       29850    29833      -17     
+ Partials      2005     1997       -8     
Flag Coverage Δ
e2e 60.33% <ø> (-0.05%) ⬇️
e2e-api 49.15% <80.00%> (+1.04%) ⬆️
unit 71.87% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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
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

2 participants