Skip to content

feat(thread_list): latest events, number of replies and automatic updates#6335

Open
stefanceriu wants to merge 2 commits intostefan/threadListServicefrom
stefan/threadListServiceAdditions
Open

feat(thread_list): latest events, number of replies and automatic updates#6335
stefanceriu wants to merge 2 commits intostefan/threadListServicefrom
stefan/threadListServiceAdditions

Conversation

@stefanceriu
Copy link
Member

@stefanceriu stefanceriu commented Mar 23, 2026

This is a continuation of #6311 which refactors the ThreadListItems to hold both the root event as well as the latest one and the total number of replies for that particular thread.

Along side those additions, this PR also starts a background taks on service construction that listens to the event cache and automatically updates the list of threads, their latest events and number of replies.

Part of #6290

  • I've documented the public API Changes in the appropriate CHANGELOG.md files.
  • This PR was made with the help of AI.

…_replies

Introduce ThreadListItemEvent as a shared struct for both the thread
root and the latest reply, replacing the previous flat fields on
ThreadListItem

The `latest_event` is populated from the bundled thread summary returned by the
server alongside the root event, as is the number of replies.
When ThreadListService is created it now immediately spawns a background
task (via the client's TaskMonitor) that subscribes to the room event
cache and listens for RoomEventCacheUpdate::UpdateTimelineEvents.

For every incoming event that carries an m.thread relation pointing to a
root we are already tracking, the service rebuilds a ThreadListItemEvent via the
existing build_latest_event helper and replaces latest_event on the matching
ThreadListItem and increments num_replies by 1
@stefanceriu stefanceriu requested a review from Hywan March 23, 2026 08:44
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 23, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing stefan/threadListServiceAdditions (fbcc0f6) with stefan/threadListService (95f150f)

Open in CodSpeed

@stefanceriu stefanceriu marked this pull request as ready for review March 23, 2026 09:12
@stefanceriu stefanceriu requested a review from a team as a code owner March 23, 2026 09:12
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.

1 participant