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: custom emoji update issues #32991

Merged
merged 18 commits into from
Nov 14, 2024
Merged

Conversation

abhinavkrin
Copy link
Member

@abhinavkrin abhinavkrin commented Aug 6, 2024

Proposed changes (including videos or screenshots)

This PR addresses two main issues with custom emoji updates in Rocket.Chat:

  1. Issue with Alias Update:

    • Users were required to upload the image again when updating a custom emoji's alias or name, leading to an error if no file was uploaded.
    • Solution: Made the file optional for the emoji-custom.update endpoint.
  2. Issue with Image Update Not Reflecting:

    • The new image was indeed updated but not reflected in browser due to browser cache. The max-age for caching is set for one year, so even if the image changed (without changing the emoji name), the URL remained the same, causing the old emoji to be loaded from the cache.
    • Solution: Created an additional hash for the emoji each time its image is changed. While rendering, attached the hash as a query to the image URL.

Also, there was a minor issue with the test related to the first issue. The test was already there but was not being executed, so we never caught the bug as it always appeared to pass. [Fixed]

Before

The aliases are not saved. The emoji could not be updated without a new file

Screen.Recording.2024-07-12.at.2.24.58.PM.mov

After

Screen.Recording.2024-07-12.at.3.29.42.PM.mov

Issue(s)

closes #26980

closes #20318
closes #21821

Closes #20317
Closes #20316

Steps to test or reproduce

Further comments

SUP-622

Copy link
Contributor

dionisio-bot bot commented Aug 6, 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 Aug 6, 2024

🦋 Changeset detected

Latest commit: 65d0ba2

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

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/model-typings Patch
@rocket.chat/core-typings Patch
@rocket.chat/meteor Patch
@rocket.chat/apps Patch
@rocket.chat/models 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/omnichannel-services Patch
rocketchat-services Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client 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/livechat Patch
@rocket.chat/rest-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
@rocket.chat/instance-status Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration 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/custom-emoji-update-issues-1 branch from 4682dbc to 0932bf5 Compare August 6, 2024 10:03
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.19%. Comparing base (7eb7941) to head (65d0ba2).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #32991   +/-   ##
========================================
  Coverage    75.19%   75.19%           
========================================
  Files          495      495           
  Lines        21601    21601           
  Branches      5362     5362           
========================================
  Hits         16242    16242           
  Misses        4717     4717           
  Partials       642      642           
Flag Coverage Δ
unit 75.19% <ø> (ø)

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

@abhinavkrin abhinavkrin marked this pull request as ready for review August 6, 2024 12:07
@abhinavkrin abhinavkrin requested review from a team as code owners August 6, 2024 12:07
@abhinavkrin abhinavkrin force-pushed the fix/custom-emoji-update-issues-1 branch from 0932bf5 to b2cc877 Compare August 8, 2024 16:12
@abhinavkrin abhinavkrin added this to the 6.12 milestone Aug 8, 2024
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.

@abhinavkrin I saw we are fixing multiple issues in this PR, would it be possible to split different fixes in different PRs? I mean, really dependent ones there should not be a problem, but I see some different and unrelated issues. WDYT?

@scuciatto scuciatto removed this from the 6.12 milestone Aug 20, 2024
KevLehman
KevLehman previously approved these changes Aug 22, 2024
KevLehman
KevLehman previously approved these changes Aug 22, 2024
KevLehman
KevLehman previously approved these changes Aug 23, 2024
Copy link
Contributor

github-actions bot commented Sep 13, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-32991/
on branch gh-pages at 2024-11-14 07:39 UTC

KevLehman
KevLehman previously approved these changes Sep 19, 2024
KevLehman and others added 4 commits November 1, 2024 15:16
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
@abhinavkrin abhinavkrin force-pushed the fix/custom-emoji-update-issues-1 branch from cba88c9 to bfc379a Compare November 1, 2024 10:05
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
@abhinavkrin abhinavkrin force-pushed the fix/custom-emoji-update-issues-1 branch from bfc379a to c8ca402 Compare November 1, 2024 10:09
MarcosSpessatto
MarcosSpessatto previously approved these changes Nov 4, 2024
@MarcosSpessatto MarcosSpessatto added this to the 7.1.0 milestone Nov 4, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 4, 2024
KevLehman
KevLehman previously approved these changes Nov 12, 2024
@tassoevan tassoevan removed the stat: QA assured Means it has been tested and approved by a company insider label Nov 13, 2024
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Nov 13, 2024
@tassoevan tassoevan added the stat: QA assured Means it has been tested and approved by a company insider label Nov 13, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 13, 2024
@kodiakhq kodiakhq bot merged commit 80e36bf into develop Nov 14, 2024
49 checks passed
@kodiakhq kodiakhq bot deleted the fix/custom-emoji-update-issues-1 branch November 14, 2024 08:31
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
7 participants