atagen

macltok

public
Star0
Watch0

Commit 6ed8c0ef3a2a

tarball

atagen <boss@atagen.co>2026-10-24 10:21 UTC

1 file changed+10-0
timeline: fetch members when a timeline opens so sender profiles fill in

Under lazy-loaded members the sdk leaves sender profiles unavailable until Timeline::fetch_members runs, and a /members fetched through members() fills the store without touching the timeline's items, so a fresh login showed bare user ids. sync_members only hits /members while the room's member list isn't synced, so reopening costs nothing.
Modified file: src/engine/timeline.rs+10 additions
@@ -79,6 +79,7 @@ pub(super) struct TimelineSession {
7979 watcher: JoinHandle<()>,
8080 pagination: mpsc::Sender<PaginationRequest>,
8181 pagination_worker: JoinHandle<()>,
82+ member_fetch: JoinHandle<()>,
8283 }
8384
8485 struct PaginationRequest {
@@ -105,6 +106,12 @@ impl TimelineSession {
105106 id.clone(),
106107 ),
107108 );
109+ // under lazy-loaded members the sdk leaves sender profiles unavailable until someone
110+ // asks, and a /members fetched any other way never reaches the timeline's items
111+ let member_fetch = context.supervisor.spawn("member fetch", {
112+ let timeline = timeline.clone();
113+ async move { timeline.fetch_members().await }
114+ });
108115 let session = Self {
109116 id,
110117 timeline,
@@ -112,6 +119,7 @@ impl TimelineSession {
112119 watcher,
113120 pagination,
114121 pagination_worker,
122+ member_fetch,
115123 context,
116124 };
117125 if session.context.initial_history_limit > 0 {
@@ -151,6 +159,7 @@ impl TimelineSession {
151159
152160 /// pending paginations answer `Interrupted` as their responders drop
153161 pub(super) async fn close(mut self) {
162+ self.member_fetch.abort();
154163 self.pagination_worker.abort();
155164 let _ = (&mut self.pagination_worker).await;
156165 self.watcher.abort();
@@ -334,6 +343,7 @@ impl Drop for TimelineSession {
334343 fn drop(&mut self) {
335344 self.watcher.abort();
336345 self.pagination_worker.abort();
346+ self.member_fetch.abort();
337347 }
338348 }