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: resolve avatar download issue on setUsername by refining service selection logic #33193

Merged
merged 9 commits into from
Sep 17, 2024

Conversation

ricardogarim
Copy link
Contributor

@ricardogarim ricardogarim commented Sep 2, 2024

As per CORE-650, this pull request addresses the issue where the avatar blob image was not being correctly set in the setUserAvatar method, resulting in an undefined error for the user. The root cause was identified as incorrect handling of avatar service selection, which led to errors during the avatar setting process.

Key changes:

  • Corrected the service handling logic to ensure the avatar blob is properly set from the first available service.
  • Enhanced the process to prioritize non-gravatar services while maintaining a fallback to gravatar if no other service is available.

Copy link
Contributor

dionisio-bot bot commented Sep 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 Sep 2, 2024

🦋 Changeset detected

Latest commit: 7a5bb19

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

This PR includes changesets to release 28 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings 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/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/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/models 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

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 59.74%. Comparing base (f27092b) to head (7a5bb19).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #33193      +/-   ##
===========================================
+ Coverage    59.70%   59.74%   +0.03%     
===========================================
  Files         2551     2552       +1     
  Lines        62792    62906     +114     
  Branches     14102    14129      +27     
===========================================
+ Hits         37492    37581      +89     
- Misses       22893    22917      +24     
- Partials      2407     2408       +1     
Flag Coverage Δ
unit 76.96% <85.71%> (+0.05%) ⬆️

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

@ricardogarim ricardogarim marked this pull request as ready for review September 2, 2024 11:25
@ricardogarim ricardogarim requested a review from a team September 2, 2024 11:25
@MarcosSpessatto MarcosSpessatto added this to the 6.13 milestone Sep 3, 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.

Is there any way we could add some tests here?

Copy link
Contributor

github-actions bot commented Sep 12, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-09-17 20:56 UTC

Copy link
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

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

for a further optimization, when calling setUsername we don't need to call getAvatarSuggestionForUser which will fetch avatar for EVERY SERVICE available, we just need the first one =)

@jessicaschelly jessicaschelly added stat: QA assured Means it has been tested and approved by a company insider and removed stat: needs testing labels Sep 17, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 17, 2024
@kodiakhq kodiakhq bot merged commit 4202d65 into develop Sep 17, 2024
50 checks passed
@kodiakhq kodiakhq bot deleted the fix/download-avatar-image-on-set-username branch September 17, 2024 20:56
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