Skip to content

fix: preference value changes causing reset to other option#7313

Merged
Rohit3523 merged 4 commits into
developfrom
preference-toggle-fix
May 14, 2026
Merged

fix: preference value changes causing reset to other option#7313
Rohit3523 merged 4 commits into
developfrom
preference-toggle-fix

Conversation

@Rohit3523
Copy link
Copy Markdown
Member

@Rohit3523 Rohit3523 commented May 8, 2026

Proposed changes

In Preferences, enabling Mobile Ringing was unintentionally disabling the Convert ASCII to Emoji setting.

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-2186

How to test or reproduce

Screenshots

Before

Screen.Recording.2026-05-08.at.10.01.21.PM.mov

After

Screen.Recording.2026-05-08.at.10.00.46.PM.mov

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Fixed preference toggles so changing one setting no longer overwrites or removes other saved preferences.
  • Tests
    • Added/updated tests to verify toggling each preference preserves the other preference and triggers preference save calls correctly.

Review Change Stack

@Rohit3523 Rohit3523 had a problem deploying to approve_e2e_testing May 8, 2026 16:35 — with GitHub Actions Error
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Walkthrough

The PR updates two preference toggle handlers to merge updated fields into the existing user.settings.preferences instead of overwriting them, and adds Jest tests that verify toggling one preference preserves the other and calls saveUserPreferences with the changed field.

Changes

Preference Handlers State Preservation

Layer / File(s) Summary
Preference Toggle Handlers
app/views/UserPreferencesView/index.tsx
toggleConvertAsciiToEmoji and toggleEnableMobileRinging now dispatch setUser with merged settings and settings.preferences, updating only the toggled preference and preserving other preference fields; saveUserPreferences and error logging remain.
UserPreferencesView tests
app/views/UserPreferencesView/UserPreferencesView.test.tsx
Adds Jest tests that stub selector state and verify that toggling one preference preserves the other in the dispatched setUser payload and that saveUserPreferences is called with the single-field update.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: preventing preference value changes from resetting other options, which directly addresses the bug where toggling one preference unintentionally reset others.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • CORE-2186: Request failed with status code 401
  • CFAC-4587: Request failed with status code 401

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.

@Rohit3523 Rohit3523 requested a review from OtavioStasiak May 8, 2026 16:39
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build May 8, 2026 16:40 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_ios_build May 8, 2026 16:40 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build May 8, 2026 16:40 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build May 8, 2026 16:40 — with GitHub Actions Error
Copy link
Copy Markdown
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

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

Missing unit tests

@Rohit3523 Rohit3523 had a problem deploying to approve_e2e_testing May 14, 2026 19:02 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build May 14, 2026 19:07 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build May 14, 2026 19:07 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build May 14, 2026 19:07 — with GitHub Actions Error
Copy link
Copy Markdown
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

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

Almost there. Just show your attachments properly on PR description.

@Rohit3523 Rohit3523 requested a deployment to approve_e2e_testing May 14, 2026 20:30 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to official_android_build May 14, 2026 20:34 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to official_ios_build May 14, 2026 20:34 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to experimental_android_build May 14, 2026 20:34 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to experimental_ios_build May 14, 2026 20:34 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 merged commit 825d547 into develop May 14, 2026
6 of 11 checks passed
@Rohit3523 Rohit3523 deleted the preference-toggle-fix branch May 14, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants