Skip to content
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

fix: settings disappear on UI navigation back and forth #32713

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

abhinavkrin
Copy link
Member

@abhinavkrin abhinavkrin commented Jul 2, 2024

Proposed changes (including videos or screenshots)

This PR addresses an issue where the "Hide System Messages" setting disappears after navigating back and forth in the Rocket.Chat UI. The problem was observed under network latency conditions when the realtime update of the setting is received much before the resolution of the saveSettings method call.
The upsert function under the PrivateSettingsCachedCollection replaced the original doc with the received fields, instead of merging with the original doc. This made the setting doc lose its shape and hence failed the isSetting
test in the UI components.

Before

before-hide-system-messages.mp4

After

after-hide-system-messages.mp4

Issue(s)

Steps to test or reproduce

  1. Navigate to the Message Settings Page: Open Chrome and go to https://your-rocketchat-domain/admin/settings/Message.
  2. Set Network Speed to Slow 3G: Open Chrome DevTools (F12 or right-click and select "Inspect"). Go to the Network tab. Select Slow 3G from the throttling options.
  3. Change a Setting: Locate the Hide System Messages setting. Click on the input field and enter User joined, then press Enter.
  4. Save the Changes: Click the Save changes button.
  5. Navigate Back and Forth: Quickly click the Back button before the "Settings saved" popup appears or wait for the "Settings saved" popup to appear, then navigate back.
  6. Navigate to Message Settings Again: Click on Message again to navigate back to the message settings page.
  7. Verify the Setting: Check if the Hide System Messages option appears on the screen.

Further comments

SUP-571

Copy link
Contributor

dionisio-bot bot commented Jul 2, 2024

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

Copy link

changeset-bot bot commented Jul 2, 2024

🦋 Changeset detected

Latest commit: 14e96c6

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

This PR includes changesets to release 32 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts 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/api-client Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/models Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status 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

@abhinavkrin abhinavkrin force-pushed the fix/settings-disappear-on-ui-navigation branch 2 times, most recently from 96bb00f to 20c5ef7 Compare July 3, 2024 09:56
Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.43%. Comparing base (4ba8c04) to head (14e96c6).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #32713      +/-   ##
===========================================
- Coverage    55.54%   54.43%   -1.12%     
===========================================
  Files         2634     2554      -80     
  Lines        57215    56026    -1189     
  Branches     11849    11622     -227     
===========================================
- Hits         31781    30495    -1286     
- Misses       22742    22924     +182     
+ Partials      2692     2607      -85     
Flag Coverage Δ
e2e 52.04% <100.00%> (-2.28%) ⬇️
unit 72.17% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@scuciatto scuciatto added this to the 6.11 milestone Jul 9, 2024
@abhinavkrin abhinavkrin force-pushed the fix/settings-disappear-on-ui-navigation branch from ae796b2 to 488d5cb Compare July 12, 2024 07:55
@abhinavkrin abhinavkrin marked this pull request as ready for review July 12, 2024 08:34
@abhinavkrin abhinavkrin requested a review from a team as a code owner July 12, 2024 08:34
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

Can we add a changeset?

@abhinavkrin abhinavkrin force-pushed the fix/settings-disappear-on-ui-navigation branch 2 times, most recently from 084b5f2 to 7013616 Compare July 16, 2024 11:44
@abhinavkrin abhinavkrin force-pushed the fix/settings-disappear-on-ui-navigation branch from 7013616 to 1f5fb95 Compare July 16, 2024 11:56
@scuciatto scuciatto added the stat: QA assured Means it has been tested and approved by a company insider label Jul 16, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 16, 2024
@kodiakhq kodiakhq bot merged commit 7d12186 into develop Jul 17, 2024
46 of 47 checks passed
@kodiakhq kodiakhq bot deleted the fix/settings-disappear-on-ui-navigation branch July 17, 2024 17:55
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.

4 participants