-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: allow users to clear bio field in profile #38277
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
Conversation
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
|
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 |
|
WalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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.
No issues found across 1 file
Codecov Report❌ Patch coverage is Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
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?
|
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
Issue(s)
Fixes #33783
Steps to test or reproduce
Expected:
Further comments
Hoping the approach works well for the fix, let me know if it does.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.