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

chore(ffi): Remove RoomInfo::latest_event #3541

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Jun 13, 2024

This patch removes RoomInfo::latest_event. To get the latest event,
one has to use RoomListItem::latest_event because it supports
local events and remote events. It was supposed to be the case of
Room::room_info too, but only when the method was called: Once the
RoomInfo was created, the latest event inside RoomInfo
was static, not dynamic. Also, this code wasn't tested
contrary to RoomListItem::latest_event which uses
matrix_sdk_ui::room_list_service::Room::latest_event which is itself
tested.


@Hywan Hywan requested a review from a team as a code owner June 13, 2024 10:16
@Hywan Hywan requested review from bnjbvr and removed request for a team June 13, 2024 10:16
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.83%. Comparing base (6d12894) to head (01a36c9).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3541   +/-   ##
=======================================
  Coverage   83.82%   83.83%           
=======================================
  Files         253      253           
  Lines       25843    25843           
=======================================
+ Hits        21664    21666    +2     
+ Misses       4179     4177    -2     

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

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.

yay! (Please make sure to address the review comments on the base PR.)

@Hywan Hywan force-pushed the chore-ffi-roominfo-latest-event branch from 36b3b8e to 63bcf51 Compare June 13, 2024 11:48
This patch removes `RoomInfo::latest_event`. To get the latest event,
one has to use `RoomListItem::latest_event` because it supports
local events and remote events. It was supposed to be the case of
`Room::room_info` too, but only when the method was called: Once the
`RoomInfo` was created, the latest event inside `RoomInfo`
was static, not dynamic. Also, this code wasn't tested
contrary to `RoomListItem::latest_event` which uses
`matrix_sdk_ui::room_list_service::Room::latest_event` which is itself
tested.
@Hywan Hywan force-pushed the chore-ffi-roominfo-latest-event branch from 63bcf51 to 01a36c9 Compare June 13, 2024 12:13
@Hywan Hywan enabled auto-merge June 13, 2024 12:14
@Hywan Hywan merged commit de5d805 into matrix-org:main Jun 13, 2024
38 checks passed
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