Skip to content

Conversation

@dougfabris
Copy link
Member

@dougfabris dougfabris commented Nov 6, 2025

Proposed changes (including videos or screenshots)

It fixes an issue where its not being possible to save nickname and bio as empty in user profile

Issue(s)

Steps to test or reproduce

Further comments

SUP-914
CORE-1431

Summary by CodeRabbit

  • Bug Fixes

    • Users can now clear and save empty values for their bio and nickname in their profile.
  • Tests

    • Added end-to-end coverage verifying that clearing bio and nickname succeeds and removes those fields from stored profile data.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 6, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2025

🦋 Changeset detected

Latest commit: 5adc4bf

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

This PR includes changesets to release 41 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/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/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/stream-hub-service 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/ui-voip 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

Allows saving empty strings for user profile bio and nickname by changing validation guards; adds test helper fields and an end-to-end test; includes a changeset declaring a patch release for @rocket.chat/meteor.

Changes

Cohort / File(s) Summary
Changeset declaration
.changeset/famous-drinks-love.md
Declares a patch release for @rocket.chat/meteor and documents the fix allowing empty bio and nickname values.
Core profile update logic
apps/meteor/server/methods/saveUserProfile.ts
Replaces truthiness guards with explicit presence checks (e.g., `settings.bio
Test utilities
apps/meteor/tests/data/users.helper.ts
Adds optional bio?: string and nickname?: string fields to the createUser test helper signature.
End-to-end testing
apps/meteor/tests/end-to-end/api/users.ts
Adds an E2E test that creates a user with bio/nickname, updates both to '' via updateOwnBasicInfo, asserts success, and verifies the stored user no longer contains those fields.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client as Client (UI)
  participant Server as saveUserProfile()
  participant DB as Database

  Client->>Server: updateOwnBasicInfo(settings:{ bio:"", nickname:"" })
  note right of Server: Guards changed to accept empty strings\n(e.g., settings.bio === '' treated as present)
  alt settings.bio present (including "")
    Server->>Server: validate type and length
    Server->>DB: update or remove bio field
  end
  alt settings.nickname present (including "")
    Server->>Server: validate type and length
    Server->>DB: update or remove nickname field
  end
  Server-->>Client: { success: true }
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review the modified guard logic in apps/meteor/server/methods/saveUserProfile.ts to ensure empty-string acceptance does not bypass intended validations.
  • Verify the new E2E test apps/meteor/tests/end-to-end/api/users.ts assertions and that the test helper changes in apps/meteor/tests/data/users.helper.ts match test runner expectations and typing.
  • Confirm .changeset/famous-drinks-love.md metadata aligns with release policies.

Poem

🐇
I munched a line, then left it bare,
Cleared the bio with gentle care,
The server nodded, saved the space,
Empty and neat — a tidy place. ✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 accurately and concisely summarizes the main change: fixing the inability to save user profile fields (nickname and bio) as empty values.
Linked Issues check ✅ Passed The PR changes fully address CORE-1431 requirements: the code modifications enable empty string values for bio and nickname fields, tests verify the fix works, and the changeset documents the patch release.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the issue: server-side guards for empty strings, test helper updates for test data, and end-to-end test validation of the fix functionality.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/erase-empty-fields

📜 Recent review details

Configuration used: CodeRabbit 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 281b381 and 5adc4bf.

📒 Files selected for processing (1)
  • apps/meteor/tests/data/users.helper.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 🚀 Notify external services - draft
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/tests/data/users.helper.ts (1)

57-58: LGTM! Test helper correctly extended to support bio and nickname fields.

The additions properly align with the PR objective to enable saving empty values for bio and nickname fields. The optional string types allow both empty strings and undefined values to be passed through to the users.create API endpoint.


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.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.97%. Comparing base (09551f9) to head (5adc4bf).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37430      +/-   ##
===========================================
- Coverage    68.99%   68.97%   -0.02%     
===========================================
  Files         3358     3358              
  Lines       114215   114215              
  Branches     20534    20534              
===========================================
- Hits         78798    78778      -20     
- Misses       33329    33344      +15     
- Partials      2088     2093       +5     
Flag Coverage Δ
e2e 57.42% <ø> (+0.01%) ⬆️
e2e-api 42.83% <100.00%> (-1.00%) ⬇️

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 dougfabris added this to the 7.13.0 milestone Nov 7, 2025
@dougfabris dougfabris marked this pull request as ready for review November 14, 2025 12:50
@dougfabris dougfabris requested a review from a team as a code owner November 14, 2025 12:50
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Nov 14, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 14, 2025
gabriellsh
gabriellsh previously approved these changes Nov 14, 2025
ricardogarim
ricardogarim previously approved these changes Nov 17, 2025
Copy link
Contributor

@ricardogarim ricardogarim left a comment

Choose a reason for hiding this comment

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

nitpick: not directly related to the changed code, but on saveUserProfile, line 114 we’re trimming the nickname twice - once on the function input and again inside the function.

Co-authored-by: Kevin Aleman <kaleman960@gmail.com>
@scuciatto scuciatto dismissed stale reviews from ricardogarim and gabriellsh via 281b381 November 18, 2025 10:20
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 367MiB 355MiB +12MiB
omnichannel-transcript-service 141MiB 141MiB -3.0KiB
queue-worker-service 141MiB 141MiB +714B
ddp-streamer-service 127MiB 127MiB +198B
account-service 114MiB 114MiB +2.6KiB
stream-hub-service 111MiB 111MiB +146B
authorization-service 111MiB 111MiB +98B
presence-service 111MiB 111MiB +864B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 11:00 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14]
  line "presence-service" [0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14]
  line "rocketchat" [0.36, 0.36, 0.35, 0.36]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 3 days):

  • 📊 Average: 1.4GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37430
  • Baseline: develop
  • Timestamp: 2025-11-18 11:00:53 UTC
  • Historical data points: 3

Updated: Tue, 18 Nov 2025 11:00:54 GMT

@kodiakhq kodiakhq bot merged commit 9f77c72 into develop Nov 18, 2025
49 checks passed
@kodiakhq kodiakhq bot deleted the fix/erase-empty-fields branch November 18, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants