Skip to content

feat(ui): RoomListService re-enables share_pos #4741

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Mar 3, 2025

WIP

The idea is the following: if we keep the sliding sync pos, first off, the homeservers will be happier because they don't have to re-compute a session every time, and second, the overall user experience may be better as we receive much less limited responses from the homeservers.

I don't know why it was creating slowness at some moment. My hope it that the problem has resolved by itself because many refactorings happened since then 🤞.


Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.15%. Comparing base (95b53d7) to head (8570354).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4741   +/-   ##
=======================================
  Coverage   86.14%   86.15%           
=======================================
  Files         292      292           
  Lines       34295    34295           
=======================================
+ Hits        29544    29547    +3     
+ Misses       4751     4748    -3     

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

@Hywan Hywan marked this pull request as ready for review March 3, 2025 09:58
@Hywan Hywan requested a review from a team as a code owner March 3, 2025 09:58
@Hywan Hywan requested review from bnjbvr and removed request for a team March 3, 2025 09:58
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Might be a bit premature to review without manual testing or some code tests 😇

@ganfra
Copy link
Contributor

ganfra commented Mar 5, 2025

Might be a bit premature to review without manual testing or some code tests 😇

Do you want me to test on android first?

@bnjbvr
Copy link
Member

bnjbvr commented Mar 5, 2025

Might be a bit premature to review without manual testing or some code tests 😇

Do you want me to test on android first?

Yes please, that would be amazing 🙏

@Hywan
Copy link
Member Author

Hywan commented Mar 21, 2025

@ganfra @pixlwave any news ❤️?

@jmartinesp
Copy link
Contributor

I've linked a rageshake with some issues where the initial loading sometimes takes several seconds and what's more troublesome, some rooms never get a display name: on a first attempt it seemed like the issue was solved after a few seconds, then I restarted the app, saw those rooms with no display name again but this time the name never loaded.

@bnjbvr
Copy link
Member

bnjbvr commented Mar 24, 2025

thanks for testing! the display name issue might be #4051 which becomes more visible, now that we're not getting multiple syncs at start.

@bnjbvr
Copy link
Member

bnjbvr commented Mar 24, 2025

Spotted a very slow response from the server, taking around 8 seconds:

2025-03-24T10:25:11.508204Z DEBUG matrix_sdk::sliding_sync: Sending request | crates/matrix-sdk/src/sliding_sync/mod.rs:547 | spans: sync_once{conn_id="room-list" pos="800706/s24077829_1_2604_32014512_8404560_11162949_18873789_46996665_0_2700"}
2025-03-24T10:25:11.508319Z TRACE matrix_sdk::http_client: Serializing request request_type="ruma_client_api::sync::sync_events::v5::Request" | crates/matrix-sdk/src/http_client/mod.rs:109 | spans: sync_once{conn_id="room-list" pos="800706/s24077829_1_2604_32014512_8404560_11162949_18873789_46996665_0_2700"} > send{server_versions=[V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 60s, retry_limit: 3 } request_id="REQ-2"}
2025-03-24T10:25:11.508431Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: sync_once{conn_id="room-list" pos="800706/s24077829_1_2604_32014512_8404560_11162949_18873789_46996665_0_2700"} > send{server_versions=[V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 60s, retry_limit: 3 } request_id="REQ-2" method=POST uri="https://element.ems.host/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="651 B"}

And much later:

2025-03-24T10:25:19.549911Z DEBUG matrix_sdk::http_client: Got response | crates/matrix-sdk/src/http_client/mod.rs:220 | spans: sync_once{conn_id="room-list" pos="800706/s24077829_1_2604_32014512_8404560_11162949_18873789_46996665_0_2700"} > send{server_versions=[V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 60s, retry_limit: 3 } request_id="REQ-2" method=POST uri="https://element.ems.host/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="651 B" status=200 response_size="1.1 kiB"}

It takes 28ms to fully process the response (including i/o access for storing the next pos), so the Rust 🦀 SDK is Blazingly 😎 Fast 🚀 .

@pixlwave
Copy link
Member

I'm afraid I can reproduce all 3 reasons why we disabled this in the first place:
#4244 (comment)

Logs for the delayed pagination:

2025-03-24T11:21:45.628899Z  INFO elementx: Paginating backwards | TimelineProxy.swift:115 | spans: root
2025-03-24T11:21:48.631601Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > paginate_backwards{room_id="!qmswaOZGwjTAUbcmtC:sync.boats"} > run_backwards_once{batch_size=20} > messages{room_id="!qmswaOZGwjTAUbcmtC:sync.boats" options=MessagesOptions { dir: Backward, limit: 20 }} > send{server_versions=[V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-51" method=GET uri="https://matrix.sync.boats/_matrix/client/v3/rooms/!qmswaOZGwjTAUbcmtC:sync.boats/messages"}
2025-03-24T11:21:48.746445Z DEBUG matrix_sdk::http_client: Got response | crates/matrix-sdk/src/http_client/mod.rs:220 | spans: root > paginate_backwards{room_id="!qmswaOZGwjTAUbcmtC:sync.boats"} > run_backwards_once{batch_size=20} > messages{room_id="!qmswaOZGwjTAUbcmtC:sync.boats" options=MessagesOptions { dir: Backward, limit: 20 }} > send{server_versions=[V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-51" method=GET uri="https://matrix.sync.boats/_matrix/client/v3/rooms/!qmswaOZGwjTAUbcmtC:sync.boats/messages" status=200 response_size="11.9 kiB"}

@bnjbvr
Copy link
Member

bnjbvr commented Mar 24, 2025

Thanks for testing, Doug!

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.

5 participants