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

Remove unnecessary Room.updateMembers() calls. #2564

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

jmartinesp
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Remove unnecessary Room.updateMembers() calls.

Some of them can be directly removed since we have a way to automatically get member info updates based on membership changes.

Others can be replaced by a simpler getUpdatedMember(userId) method. This might still do a full member sync, but it's quite unlikely, and even if it does it we won't have to map every fetched user before we can use the result.

Motivation and context

After testing the improved room member list and updateMembers() sometimes causing 45MB of data to be loaded for the Matrix HQ room, I want to reduce these calls as much as possible. It should also improve performance since we avoid unnecessary data mapping.

Tests

There should be no changes. I tested the following flows:

  • In a DM, have the other user leave the room. Then tap on the message composer to re-invite them.
  • Open the room details screen of a user, block and unblock them.
  • Invite a new user to a room.
  • Open the room member list.

As far as I could tell they all still worked as expected.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

Some of them can be directly removed since we have a way to automatically get member info updates based on membership changes.

Others can be replaced by a simpler `getUpdatedMember` method. This might still need a full member sync, but it's quite unlikely.
@jmartinesp jmartinesp requested a review from bmarty March 18, 2024 13:26
@jmartinesp jmartinesp requested a review from a team as a code owner March 18, 2024 13:26
Copy link
Contributor

github-actions bot commented Mar 18, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/utsQhi

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 73.14%. Comparing base (1e4300d) to head (4159160).
Report is 3 commits behind head on develop.

Files Patch % Lines
...droid/libraries/matrix/test/room/FakeMatrixRoom.kt 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2564      +/-   ##
===========================================
- Coverage    73.14%   73.14%   -0.01%     
===========================================
  Files         1408     1408              
  Lines        34103    34102       -1     
  Branches      6620     6620              
===========================================
- Hits         24945    24944       -1     
  Misses        5698     5698              
  Partials      3460     3460              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM at first sight. Thanks!

Copy link

sonarcloud bot commented Mar 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Mar 18, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Mar 18, 2024
@jmartinesp jmartinesp enabled auto-merge (squash) March 18, 2024 14:42
@jmartinesp jmartinesp merged commit 883d834 into develop Mar 18, 2024
19 checks passed
@jmartinesp jmartinesp deleted the misc/jme/remove-unnecessary-update-members-calls branch March 18, 2024 14:57
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.

None yet

2 participants