Skip to content

ffi: Refactor timeline creation and lifetimes #5058

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

Merged
merged 14 commits into from
May 21, 2025
Merged

ffi: Refactor timeline creation and lifetimes #5058

merged 14 commits into from
May 21, 2025

Conversation

stefanceriu
Copy link
Member

This PR implements the plan laid out in #4718: it removes long living timeline instances from the room list service and its items in favor of directly creating a timeline through its parent room and the timeline_with_configuration method.

In order to do so it also moves the previously internally configured UTD hook to the FFI client and exposes an option to use it on the aforementioned timeline configuration method.

NB: the event filter is already exposed in the configuration and the event cache is now enabled by default.

@stefanceriu stefanceriu requested a review from a team as a code owner May 19, 2025 13:11
@stefanceriu stefanceriu requested review from andybalaam, Hywan and bnjbvr and removed request for a team and andybalaam May 19, 2025 13:11
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.

Looks like this is on the right track, thanks for taking a stab at this!

@bnjbvr bnjbvr removed the request for review from Hywan May 19, 2025 13:25
@bnjbvr
Copy link
Member

bnjbvr commented May 19, 2025

(removing Ivan from the reviewer list, as I've reviewed it.)

Copy link

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.86%. Comparing base (ea4c9a4) to head (3287304).
Report is 54 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5058   +/-   ##
=======================================
  Coverage   85.85%   85.86%           
=======================================
  Files         325      325           
  Lines       35937    35920   -17     
=======================================
- Hits        30855    30841   -14     
+ Misses       5082     5079    -3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefanceriu stefanceriu requested a review from bnjbvr May 19, 2025 16:49
@bnjbvr bnjbvr changed the title Refactor timeline creation and lifetimes ffi: Refactor timeline creation and lifetimes May 21, 2025
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.

lgtm, thanks! we can likely get rid of more room wrappers in the SDK, after this…

Ideally, in terms of clean history management, we'd do some tidying up of the commits here:

  • the "make ci happy" only contains changes that ought to be included in other commits. git absorb is your friend in this kind of situations!
  • the commit introducing the OnceLock for the UTD hook manager ought to be squashed with the other one that introduced the Arc<Mutex<...>> because this commit is undoing things that another commit made (fixup commit FTW!).

… timeline

As per the plan defined in #4718:

```
the room_list_service::room::RoomInner shouldn't make use of its inner timeline;
it's only used in a direct getter, or to compute the latest room event, but it's not working
as intended, since local echoes aren't properly displayed in the room list.
This non-working feature can be removed, in favor of #4112
```
…callback (dropped in favor of the `ClientSessionDelegate`)
@stefanceriu stefanceriu merged commit d84cf06 into main May 21, 2025
43 checks passed
@stefanceriu stefanceriu deleted the stefan/4718 branch May 21, 2025 13:38
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