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

feat(ui): Revisit required_state for RoomListService #4159

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Oct 22, 2024

This patch updates matrix_sdk_ui::room_list_service, and is twofold:

First off, it adds m.call.member, m.room.topic and m.room.pinned_events to
required_state of the all_rooms sliding sync list.

Second, this required_state sliding sync list value is easily out-of-sync with
the required_state sliding sync room subscription value. Thus, this patch
removes the settings argument of RoomListService::subscribe_to_rooms and
computes its own RoomSubscription instance. For required_state, it uses the
same required_state used by the all_rooms list, plus the m.room.create
state event. For timeline_limit, it uses 20 by default (this is not the
default value we were using in our tests, but that's the default value most
Matrix clients use).

Hywan added 2 commits October 22, 2024 13:22
This patch adds the `m.call.member` state event in the `required_state`
for `all_rooms` of the `RoomListService`.
This patch adds the `m.room.topic` and `m.room.pinned_events` state
events in the `required_state` of the `all_rooms` sliding sync list of
`RoomListService`.
@Hywan Hywan force-pushed the feat-ui-room-list-required-state branch from e2bbc5d to 6bca1ab Compare October 22, 2024 11:59
@Hywan Hywan marked this pull request as ready for review October 22, 2024 11:59
@Hywan Hywan requested a review from a team as a code owner October 22, 2024 11:59
@Hywan Hywan requested review from jmartinesp, stefanceriu and a team and removed request for a team and jmartinesp October 22, 2024 11:59
@Hywan Hywan force-pushed the feat-ui-room-list-required-state branch 3 times, most recently from bab2cc7 to 4f586ff Compare October 22, 2024 12:11
Hywan added 2 commits October 22, 2024 14:25
…ings` argument.

This patch removes the `settings` argument of
`RoomListService::subscribe_to_rooms`. The settings were mostly composed
of:

* `required_state`: now shared with `all_rooms`, so that we are
  sure they are synced; except that `m.room.create` is added for
  subscriptions.
* `timeline_limit`: now defaults to 20.

This patch thus creates the `DEFAULT_REQUIRED_STATE` and
`DEFAULT_ROOM_SUBSCRIPTION_TIMELINE_LIMIT` constants.

Finally, this patch updates the tests, and updates all usages of
`subscribe_to_rooms`.
…onstant.

This patch refactors 2 `chain(once(…))` with a 1 `chain`. It
also clarifies the extra `required_state` that are added for room
subscriptions.
@Hywan Hywan force-pushed the feat-ui-room-list-required-state branch from 66721b6 to 1c6399c Compare October 22, 2024 12:25
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.83%. Comparing base (9c03c5d) to head (1c6399c).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4159   +/-   ##
=======================================
  Coverage   84.82%   84.83%           
=======================================
  Files         269      269           
  Lines       28862    28858    -4     
=======================================
- Hits        24482    24481    -1     
+ Misses       4380     4377    -3     

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

Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

Talked about most of this offline, looks good to me and works well in EXI

@@ -151,8 +151,8 @@ impl RoomListService {
(StateEventType::RoomMember, "$ME".to_owned()),
(StateEventType::RoomName, "".to_owned()),
(StateEventType::RoomCanonicalAlias, "".to_owned()),
(StateEventType::RoomAvatar, "".to_owned()),
Copy link
Member

Choose a reason for hiding this comment

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

Best leave an explanation for this

Copy link
Member Author

Choose a reason for hiding this comment

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

I cannot add a comment in the code, but I can comment here.

Sliding sync already supplies a response.avatar value, so we don't need to request the m.room.avatar state event.

@Hywan Hywan merged commit 65bb373 into matrix-org:main Oct 22, 2024
40 checks passed
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 22, 2024
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 23, 2024
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 23, 2024
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 23, 2024
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 23, 2024
stefanceriu added a commit that referenced this pull request Oct 24, 2024
…e through sliding sync

- introduced in #4159 with an empty string
- call members use custom `state_key`s and as such not specifying the sentinel won't match them and state won't be returned
stefanceriu added a commit that referenced this pull request Oct 24, 2024
…e through sliding sync

- introduced in #4159 with an empty string
- call members use custom `state_key`s and as such not specifying the sentinel won't match them and state won't be returned
stefanceriu added a commit that referenced this pull request Oct 24, 2024
…e through sliding sync

- introduced in #4159 with an empty string
- call members use custom `state_key`s and as such not specifying the sentinel won't match them and state won't be returned
stefanceriu added a commit that referenced this pull request Oct 24, 2024
…e through sliding sync

- introduced in #4159 with an empty string
- call members use custom `state_key`s and as such not specifying the sentinel won't match them and state won't be returned
BillCarsonFr added a commit to element-hq/element-x-android that referenced this pull request Oct 24, 2024
BillCarsonFr added a commit to element-hq/element-x-android that referenced this pull request Oct 24, 2024
jmartinesp added a commit to element-hq/element-x-android that referenced this pull request Oct 24, 2024
* Bump rust-sdk version to rust-sdk 0.2.57

* rust sdk update: Support persisted WedgeQueueError

* Trust & Decoration | Support new expected UTD causes

* Room Subscribtion settings not needed anymore (see matrix-org/matrix-rust-sdk#4159)

* File/Attachement upload: update to support `storeInCache`

* feat(knock): update API to use reason and serverNames

* Add another `Konsist` exception

* Update screenshots

---------

Co-authored-by: Jorge Martín <[email protected]>
Co-authored-by: ElementBot <[email protected]>
Co-authored-by: Benoit Marty <[email protected]>
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