-
Notifications
You must be signed in to change notification settings - Fork 13k
fix(user-profile): enable saving empty bio to clear user profile field #38166
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
|
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: 40a3ed2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 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 |
WalkthroughRefactored Users model bio persistence: Changes
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
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
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
|
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! |
|
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?
|
|
Thanks @dougfabris! I appreciate the update. Glad to see the issue is resolved. I'll look for other open issues to contribute to. |
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
$unsetthe 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.setBiomodel to explicitly save the empty string""using$setinstead 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
Further comments
The previous implementation used logic to
$unsetthe 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
Chores
✏️ Tip: You can customize this high-level summary in your review settings.