31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1 | use std::collections::{HashMap, VecDeque}; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 2 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 3 | use matrix_sdk::{Room, RoomState}; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 4 | use matrix_sdk_ui::timeline::{RoomExt, Timeline, TimelineFocus, TimelineReadReceiptTracking}; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 5 | use ruma::{OwnedEventId, OwnedRoomId}; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 6 | use tokio::{ |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 7 | sync::mpsc, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 8 | task::{AbortHandle, JoinSet}, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 9 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 10 | |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 11 | use super::timeline::{SessionContext, TaskGuard, TimelineSession}; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 12 | use crate::{ |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 13 | Error, ErrorKind, Event, TimelineCommand, TimelineId, TypingState, transport::Responder, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 14 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 15 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 16 | pub(super) enum ActorRequest { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 17 | /// opening an open room answers with a fresh reset |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 18 | Open(Responder), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 19 | Execute(TimelineCommand, Responder), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 20 | Close(Responder), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 21 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 22 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 23 | impl ActorRequest { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 24 | pub(super) fn into_reply(self) -> Responder { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 25 | match self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 26 | Self::Open(reply) | Self::Execute(_, reply) | Self::Close(reply) => reply, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 27 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 28 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 29 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 30 | |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 31 | pub(super) enum ActorNote { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 32 | /// stopping on its own, after a leave or a kick. anything sent its way now comes back in `Exited` |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 33 | Leaving { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 34 | room_id: OwnedRoomId, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 35 | generation: u64, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 36 | }, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 37 | Exited { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 38 | room_id: OwnedRoomId, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 39 | generation: u64, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 40 | /// requests that arrived too late to be served, for the engine to answer or replay |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 41 | leftovers: Vec<ActorRequest>, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 42 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 43 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 44 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 45 | pub(super) struct RoomActor { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 46 | pub(super) room_id: OwnedRoomId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 47 | pub(super) generation: u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 48 | pub(super) room: Room, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 49 | pub(super) requests: mpsc::Receiver<ActorRequest>, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 50 | pub(super) notes: mpsc::UnboundedSender<ActorNote>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 51 | pub(super) context: SessionContext, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 52 | pub(super) panics: mpsc::UnboundedReceiver<&'static str>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 53 | pub(super) opening: Vec<Responder>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 54 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 55 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 56 | impl RoomActor { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 57 | pub(super) async fn run(mut self) { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 58 | self.serve().await; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 59 | self.requests.close(); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 60 | let mut leftovers = Vec::new(); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 61 | while let Ok(request) = self.requests.try_recv() { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 62 | leftovers.push(request); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 63 | } |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 64 | let _ = self.notes.send(ActorNote::Exited { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 65 | room_id: self.room_id.clone(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 66 | generation: self.generation, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 67 | leftovers, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 68 | }); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 69 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 70 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 71 | async fn serve(&mut self) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 72 | let timeline = match build_timeline( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 73 | &self.room, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 74 | TimelineFocus::Live { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 75 | hide_threaded_events: true, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 76 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 77 | ) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 78 | .await |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 79 | { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 80 | Ok(timeline) => timeline, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 81 | Err(error) => return self.refuse_everything(error).await, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 82 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 83 | let Ok(room_timeline) = TimelineSession::start( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 84 | TimelineId::Room(self.room_id.clone()), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 85 | timeline, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 86 | self.context.clone(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 87 | ) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 88 | .await |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 89 | else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 90 | return; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 91 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 92 | for reply in self.opening.drain(..) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 93 | reply.done(Ok(())); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 94 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 95 | let (typing_guard, typing) = self.room.subscribe_to_typing_notifications(); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 96 | let typing_watcher = TaskGuard(self.context.supervisor.spawn( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 97 | "typing watcher", |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 98 | watch_typing(self.room_id.clone(), typing, self.context.events.clone()), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 99 | )); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 100 | let mut timelines = Timelines { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 101 | room: room_timeline, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 102 | threads: Threads::new(self.requests.max_capacity()), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 103 | work: JoinSet::new(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 104 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 105 | let close = self.serve_open(&mut timelines).await; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 106 | if close.is_none() { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 107 | self.requests.close(); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 108 | let _ = self.notes.send(ActorNote::Leaving { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 109 | room_id: self.room_id.clone(), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 110 | generation: self.generation, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 111 | }); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 112 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 113 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 114 | // let redactions and receipts that already left finish rather than lie about them |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 115 | while timelines.work.join_next().await.is_some() {} |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 116 | drop(typing_guard); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 117 | drop(typing_watcher); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 118 | timelines.threads.close().await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 119 | timelines.room.close().await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 120 | if let Some(reply) = close { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 121 | reply.done(Ok(())); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 122 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 123 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 124 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 125 | /// returns the close request's responder, if a close is why we stopped |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 126 | async fn serve_open(&mut self, timelines: &mut Timelines) -> Option<Responder> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 127 | let mut room_info = self.room.subscribe_info(); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 128 | // a leave that landed while the timeline was building won't come round again |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 129 | if matches!(self.room.state(), RoomState::Left | RoomState::Banned) { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 130 | return None; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 131 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 132 | loop { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 133 | tokio::select! { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 134 | Some(info) = room_info.next() => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 135 | if matches!(info.state(), RoomState::Left | RoomState::Banned) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 136 | tracing::debug!(room_id = %self.room_id, "room actor stopped because we left the room"); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 137 | return None; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 138 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 139 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 140 | request = self.requests.recv() => match request { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 141 | None => return None, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 142 | Some(ActorRequest::Close(reply)) => return Some(reply), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 143 | Some(ActorRequest::Open(reply)) => reply.done(timelines.room.resync().await), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 144 | Some(ActorRequest::Execute(command, reply)) => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 145 | timelines.execute(command, reply, &self.room).await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 146 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 147 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 148 | Some(built) = timelines.threads.builds.join_next(), if !timelines.threads.builds.is_empty() => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 149 | timelines.thread_built(built, &self.room_id, &self.context).await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 150 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 151 | Some(label) = self.panics.recv() => panic!("{label} panicked in room {}", self.room_id), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 152 | Some(done) = timelines.work.join_next(), if !timelines.work.is_empty() => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 153 | if let Err(error) = done && error.is_panic() { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 154 | tracing::warn!(room_id = %self.room_id, %error, "timeline operation panicked"); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 155 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 156 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 157 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 158 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 159 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 160 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 161 | async fn refuse_everything(&mut self, error: matrix_sdk_ui::timeline::Error) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 162 | tracing::warn!(%error, room_id = %self.room_id, "room actor could not build its timeline"); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 163 | let error = Error::with_source(ErrorKind::Timeline, "room timeline build failed", error); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 164 | for reply in self.opening.drain(..) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 165 | reply.done(Err(error.clone())); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 166 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 167 | self.requests.close(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 168 | while let Some(request) = self.requests.recv().await { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 169 | request.into_reply().done(Err(error.clone())); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 170 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 171 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 172 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 173 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 174 | async fn build_timeline( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 175 | room: &Room, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 176 | focus: TimelineFocus, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 177 | ) -> Result<Timeline, matrix_sdk_ui::timeline::Error> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 178 | room.timeline_builder() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 179 | .with_focus(focus) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 180 | .track_read_marker_and_receipts(TimelineReadReceiptTracking::AllEvents) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 181 | .build() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 182 | .await |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 183 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 184 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 185 | async fn watch_typing( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 186 | room_id: OwnedRoomId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 187 | mut typing: tokio::sync::broadcast::Receiver<Vec<ruma::OwnedUserId>>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 188 | events: crate::transport::EventSender, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 189 | ) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 190 | loop { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 191 | match typing.recv().await { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 192 | Ok(users) => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 193 | let state = TypingState { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 194 | room_id: room_id.clone(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 195 | users, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 196 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 197 | if events.send(Event::TypingChanged(state)).await.is_err() { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 198 | return; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 199 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 200 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 201 | Err(tokio::sync::broadcast::error::RecvError::Lagged(skipped)) => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 202 | tracing::warn!(%room_id, skipped, "typing watcher lagged"); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 203 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 204 | Err(tokio::sync::broadcast::error::RecvError::Closed) => return, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 205 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 206 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 207 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 208 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 209 | struct Timelines { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 210 | room: TimelineSession, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 211 | threads: Threads, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 212 | work: JoinSet<()>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 213 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 214 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 215 | impl Timelines { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 216 | async fn execute(&mut self, command: TimelineCommand, reply: Responder, room: &Room) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 217 | match command { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 218 | TimelineCommand::OpenThread { root_event_id, .. } => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 219 | self.threads.open(root_event_id, reply, room); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 220 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 221 | TimelineCommand::CloseThread { root_event_id, .. } => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 222 | reply.done(self.threads.close_one(&root_event_id).await); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 223 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 224 | TimelineCommand::Resync { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 225 | timeline_id: TimelineId::Room(_), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 226 | } => reply.done(self.room.resync().await), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 227 | command => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 228 | let root = command |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 229 | .timeline_id() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 230 | .and_then(TimelineId::thread_root) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 231 | .cloned(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 232 | let Some(root) = root else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 233 | return self.room.execute(command, reply, &mut self.work).await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 234 | }; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 235 | if let TimelineCommand::MarkRead { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 236 | timeline_id, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 237 | event_id, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 238 | } = &command |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 239 | && !self.threads.open.contains_key(&root) |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 240 | { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 241 | let client = room.client(); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 242 | let (timeline_id, event_id) = (timeline_id.clone(), event_id.clone()); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 243 | self.work.spawn(async move { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 244 | reply.done( |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 245 | super::commands::mark_read(&client, &timeline_id, event_id).await, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 246 | ); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 247 | }); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 248 | return; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 249 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 250 | match self.threads.route(root, command, reply) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 251 | Routed::Open(session, TimelineCommand::Resync { .. }, reply) => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 252 | reply.done(session.resync().await); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 253 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 254 | Routed::Open(session, command, reply) => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 255 | session.execute(command, reply, &mut self.work).await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 256 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 257 | Routed::Queued => {} |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 258 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 259 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 260 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 261 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 262 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 263 | async fn thread_built( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 264 | &mut self, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 265 | built: Result<Built, tokio::task::JoinError>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 266 | room_id: &OwnedRoomId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 267 | context: &SessionContext, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 268 | ) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 269 | let Some((root, queued, timeline)) = self.threads.built(built) else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 270 | return; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 271 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 272 | let timeline = match timeline { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 273 | Ok(timeline) => timeline, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 274 | Err(error) => { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 275 | tracing::warn!(%error, %room_id, %root, "thread timeline build failed"); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 276 | let error = |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 277 | Error::with_source(ErrorKind::Timeline, "thread timeline build failed", error); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 278 | for (_, reply) in queued { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 279 | reply.done(Err(error.clone())); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 280 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 281 | return; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 282 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 283 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 284 | let id = TimelineId::thread(room_id.clone(), root.clone()); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 285 | let Ok(session) = TimelineSession::start(id, timeline, context.clone()).await else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 286 | return; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 287 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 288 | let session = self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 289 | .threads |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 290 | .open |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 291 | .entry(root) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 292 | .insert_entry(session) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 293 | .into_mut(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 294 | for (command, reply) in queued { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 295 | match command { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 296 | None => reply.done(Ok(())), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 297 | Some(TimelineCommand::Resync { .. }) => reply.done(session.resync().await), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 298 | Some(command) => session.execute(command, reply, &mut self.work).await, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 299 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 300 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 301 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 302 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 303 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 304 | type Built = ( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 305 | OwnedEventId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 306 | u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 307 | Result<Timeline, matrix_sdk_ui::timeline::Error>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 308 | ); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 309 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 310 | /// `None` is the open itself, everything else waits behind it |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 311 | type Queued = VecDeque<(Option<TimelineCommand>, Responder)>; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 312 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 313 | enum Routed<'a> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 314 | Open(&'a mut TimelineSession, TimelineCommand, Responder), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 315 | Queued, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 316 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 317 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 318 | struct OpeningThread { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 319 | generation: u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 320 | build: AbortHandle, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 321 | queued: Queued, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 322 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 323 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 324 | struct Threads { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 325 | open: HashMap<OwnedEventId, TimelineSession>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 326 | opening: HashMap<OwnedEventId, OpeningThread>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 327 | builds: JoinSet<Built>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 328 | next_generation: u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 329 | queued: usize, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 330 | capacity: usize, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 331 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 332 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 333 | impl Threads { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 334 | fn new(capacity: usize) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 335 | Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 336 | open: HashMap::new(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 337 | opening: HashMap::new(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 338 | builds: JoinSet::new(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 339 | next_generation: 0, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 340 | queued: 0, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 341 | capacity, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 342 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 343 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 344 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 345 | fn enqueue(&mut self, root: &OwnedEventId, command: Option<TimelineCommand>, reply: Responder) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 346 | if self.queued >= self.capacity { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 347 | return reply.done(Err(Error::new( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 348 | ErrorKind::QueueFull, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 349 | "thread command queue is full", |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 350 | ))); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 351 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 352 | let Some(opening) = self.opening.get_mut(root) else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 353 | return reply.done(Err(Error::new( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 354 | ErrorKind::TimelineNotOpen, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 355 | "thread timeline is not open", |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 356 | ))); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 357 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 358 | opening.queued.push_back((command, reply)); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 359 | self.queued += 1; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 360 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 361 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 362 | fn open(&mut self, root: OwnedEventId, reply: Responder, room: &Room) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 363 | if self.open.contains_key(&root) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 364 | return reply.done(Ok(())); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 365 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 366 | if !self.opening.contains_key(&root) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 367 | let generation = self.next_generation; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 368 | self.next_generation = self.next_generation.wrapping_add(1); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 369 | let room = room.clone(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 370 | let build_root = root.clone(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 371 | let build = self.builds.spawn(async move { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 372 | let focus = TimelineFocus::Thread { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 373 | root_event_id: build_root.clone(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 374 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 375 | (build_root, generation, build_timeline(&room, focus).await) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 376 | }); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 377 | self.opening.insert( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 378 | root.clone(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 379 | OpeningThread { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 380 | generation, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 381 | build, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 382 | queued: VecDeque::new(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 383 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 384 | ); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 385 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 386 | self.enqueue(&root, None, reply); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 387 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 388 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 389 | fn route( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 390 | &mut self, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 391 | root: OwnedEventId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 392 | command: TimelineCommand, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 393 | reply: Responder, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 394 | ) -> Routed<'_> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 395 | if !self.open.contains_key(&root) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 396 | self.enqueue(&root, Some(command), reply); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 397 | return Routed::Queued; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 398 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 399 | let session = self.open.get_mut(&root).expect("thread was just checked"); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 400 | Routed::Open(session, command, reply) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 401 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 402 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 403 | /// `None` when the build belongs to a thread that was closed while it ran |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 404 | fn built( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 405 | &mut self, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 406 | built: Result<Built, tokio::task::JoinError>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 407 | ) -> Option<( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 408 | OwnedEventId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 409 | Queued, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 410 | Result<Timeline, matrix_sdk_ui::timeline::Error>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 411 | )> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 412 | let (root, generation, timeline) = match built { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 413 | Ok(built) => built, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 414 | Err(error) if error.is_cancelled() => return None, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 415 | Err(error) => std::panic::resume_unwind(error.into_panic()), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 416 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 417 | if self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 418 | .opening |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 419 | .get(&root) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 420 | .is_none_or(|opening| opening.generation != generation) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 421 | { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 422 | return None; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 423 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 424 | let opening = self.opening.remove(&root)?; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 425 | self.queued -= opening.queued.len(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 426 | Some((root, opening.queued, timeline)) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 427 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 428 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 429 | async fn close_one(&mut self, root: &OwnedEventId) -> Result<(), Error> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 430 | if let Some(session) = self.open.remove(root) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 431 | session.close().await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 432 | return Ok(()); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 433 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 434 | let Some(opening) = self.opening.remove(root) else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 435 | return Err(Error::new( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 436 | ErrorKind::TimelineNotOpen, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 437 | "thread timeline is not open", |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 438 | )); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 439 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 440 | opening.build.abort(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 441 | self.queued -= opening.queued.len(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 442 | Ok(()) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 443 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 444 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 445 | async fn close(&mut self) { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 446 | self.builds.abort_all(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 447 | while self.builds.join_next().await.is_some() {} |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 448 | self.opening.clear(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 449 | for (_, session) in self.open.drain() { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 450 | session.close().await; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 451 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 452 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 453 | } |