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

@Rohit3523 Rohit3523 commented May 8, 2026

Copy link
Copy Markdown
Member

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

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

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

@diegolmello diegolmello left a comment

Copy link
Copy Markdown
Member

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

@diegolmello diegolmello left a comment

Copy link
Copy Markdown
Member

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 had a problem deploying to approve_e2e_testing May 14, 2026 20:30 — with GitHub Actions Failure
@Rohit3523
Rohit3523 had a problem deploying to official_android_build May 14, 2026 20:34 — with GitHub Actions Failure
@Rohit3523
Rohit3523 had a problem deploying to official_ios_build May 14, 2026 20:34 — with GitHub Actions Failure
@Rohit3523
Rohit3523 had a problem deploying to experimental_android_build May 14, 2026 20:34 — with GitHub Actions Failure
@Rohit3523
Rohit3523 had a problem deploying to experimental_ios_build May 14, 2026 20:34 — with GitHub Actions Failure
@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
OtavioStasiak added a commit that referenced this pull request May 20, 2026
* feat: alt text

* action: organized translations

* fix: move alt text accessibility to button level and fix gallery height

* chore: format code and fix lint issues

* ix: stable gallery keys and forward alt text accessibility to gallery items

* fix: i18n fallbacks, alt text a11y label, stale altText on remove, and 8.4.0 boundary test

* action: organized translations

* fix: i18n

* action: organized translations

* fix: preserve caption on send, correct version gate for share extension, and translated a11y labels in gallery

* fix: alt text label

* feat: queue composer attachments inline

* feat: open attachment alt text in action sheet

* fix: remove image gallery

* action: organized translations

* feat: edit message alt text

* chore: format code and fix lint issues

* feat: backward compatibilities

* fix: edit

* remove image gallery

* fix: conflicts

* code improvements

* fix: composer

* code improvements

* fix: tests

* fix(a11y): improve image attachment accessibility labels and order

* action: organized translations

* fix: unit tests

* fix: focus

* fix: a11y labels

* chore: format code and fix lint issues

* test

* fix: merge conflicts

* feat: improve a11y experience

* fix: unlabelled on android

* fix: action sheet input keyboard

* fix: announce GIFs as interactive in ImageViewer for screen readers

* fix: ignore whitespace-only alt text in message a11y label

* refactor: extract sendAttachments helper from composer and share view

* action: organized translations

* feat: code improvements

* code improvements

* refactor: extract useImageDescriptionLabel hook and inline useAltTextSupported in Image

* fix: i18n

* action: organized translations

* refactor: stabilize FlatList renderers and harden altText checks

* fix(a11y): omit empty segments in message accessibilityLabel

* refactor: extract normalizeAttachment and preserve handler order
  in useChooseMedia

* refactor: extract normalizeAttachment and preserve handler order
  in useChooseMedia

* rollback prettier changes

* feat: attachment action sheet stories and test

* feat: attachment actionsheet stories and tests

* feat: announce images without description to screen readers

* action: organized translations

* fix: render Attachment file name in Thread Message preview when body is empty (#7323)

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

* fix: do not encrypt messages when workspace E2E is disabled (#7324)

* fix: snapshot test

* fix: snapshot test

* feat: unify thumbs

* efactor: rename handlePickedAttachments to handleSelectedAttachments

* fix: pass altText and isAnimated to ImageViewer in ShareView Preview

* refactor: make AltTextLabel altText optional with early return

* fix: stop leaking attachment.altText into caption rendering

* fix: if no alt text its rendering an empty absolute view

* test: cover useMessageAccessibilityLabel and keep suffix on
  translated

* refactor: prefer title_link/message_link over index for Reply attachment key

* refactor: unify ShareView Thumbs and ComposerAttachments under
  shared AttachmentThumbs

* feat: unify Thumbs

* remove memo of useImageDescriptionLabel

* fix: test and lint

* fix: test

* fix: i18n missing translation

* fix: fallback accessibility label when alt text is empty

* fix: remove unused code

* rollback prettier changes

* refactor: colocate useImageDescriptionLabel with message hooks

* refactor: simplify message accessibility label composition

* feat: add missing keys

* feat: use thumb as children instead of add it again

* refactor: tighten types and stable keys in message/share views

* fix: useTheme on AltTextInput

* action: organized translations

* chore: code organization

* chore: type improvement

* chore: code organization

* fix: image improvement

* code improvements

* fix: avoid undefined a11y label

* fix: altText trim and improvements

* fix: tests

* fix: use memo composer attachments

* chore: remove editAltText (not available)

* feat: standardize shareView composer

---------

Co-authored-by: OtavioStasiak <OtavioStasiak@users.noreply.github.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com>
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