Skip to content

fix: remove getAvatarSuggestion deprecated method#6948

Merged
OtavioStasiak merged 4 commits intodevelopfrom
fix.deprecated-method-get-avatar-suggestion
Feb 5, 2026
Merged

fix: remove getAvatarSuggestion deprecated method#6948
OtavioStasiak merged 4 commits intodevelopfrom
fix.deprecated-method-get-avatar-suggestion

Conversation

@OtavioStasiak
Copy link
Contributor

@OtavioStasiak OtavioStasiak commented Jan 26, 2026

Proposed changes

Remove deprecated method based on https://docs.rocket.chat/docs/deprecated-and-phasing-out-features.

Issue(s)

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

How to test or reproduce

  • Open the app;
  • Go to ChangeAvatarView;
  • The result must be the same as web;

Screenshots

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

  • New Features
    • Added support for avatar suggestions across multiple services for compatible server versions, with backward compatibility maintained for older deployments.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

Walkthrough

A new REST endpoint for avatar suggestions is introduced with server version gating. The implementation uses the new endpoint for servers 5.4.0+, while maintaining backward compatibility with older versions through fallback logic.

Changes

Cohort / File(s) Change Summary
Avatar Suggestion Endpoint
app/definitions/rest/v1/users.ts
Added new GET endpoint users.getAvatarSuggestion with return type containing suggestions map and success boolean. Updated imports to include IAvatarSuggestion.
Avatar Suggestion Service
app/lib/services/restApi.ts
Made getAvatarSuggestion async. Added version gating logic: calls new REST endpoint for servers ≥5.4.0; falls back to SDK method call for older servers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • diegolmello

Poem

🐰 A rabbit hops through avatar dreams,
New endpoints flow in version streams,
With graceful gates for versions old,
Compatibility—a treasure to hold!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title states 'remove getAvatarSuggestion deprecated method', but the changes actually add a new endpoint and implement backward compatibility with server version gating, not remove the method. Consider revising the title to reflect the actual changes, such as 'feat: add getAvatarSuggestion endpoint with backward compatibility for server 5.4.0+' to accurately describe the addition and version gating implementation.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix.deprecated-method-get-avatar-suggestion

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.

@OtavioStasiak OtavioStasiak requested a deployment to experimental_android_build February 5, 2026 20:20 — with GitHub Actions Waiting
@OtavioStasiak OtavioStasiak requested a deployment to official_android_build February 5, 2026 20:20 — with GitHub Actions Waiting
@OtavioStasiak OtavioStasiak requested a deployment to experimental_ios_build February 5, 2026 20:20 — with GitHub Actions Waiting
@OtavioStasiak OtavioStasiak merged commit 047660f into develop Feb 5, 2026
5 of 10 checks passed
@OtavioStasiak OtavioStasiak deleted the fix.deprecated-method-get-avatar-suggestion branch February 5, 2026 20:20
OtavioStasiak added a commit that referenced this pull request Feb 5, 2026
* chore: type of getAvatarSuggestion

* chore: add getAvatarSuggestion endpoint and backward compatibility

* chore: format code and fix lint issues [skip ci]

---------

Co-authored-by: OtavioStasiak <OtavioStasiak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants