diff --git a/src/service/migrations.rs b/src/service/migrations.rs index b14a74422..53dc5567e 100644 --- a/src/service/migrations.rs +++ b/src/service/migrations.rs @@ -986,6 +986,14 @@ async fn unembed_unsigned_info( info!(elapsed=?start.elapsed(), total_migrated_pdus=total_migrated, "Finished migration."); } +async fn drop_server_signingkeys(services: &Services) -> Result<()> { + services.db.db.drop_column("server_signingkeys")?; + + info!("Cleared server_signingkeys."); + + Ok(()) +} + const ROOMTS_UNTIL: &str = "populate_roomts_pduid_until"; async fn populate_roomts_pduid(db: Arc, until: u64) { @@ -1018,14 +1026,6 @@ async fn populate_roomts_pduid(db: Arc, until: u64) { info!(elapsed = ?start.elapsed(), "Finished indexing PDUs by timestamp."); } -async fn drop_server_signingkeys(services: &Services) -> Result<()> { - services.db.db.drop_column("server_signingkeys")?; - - info!("Cleared server_signingkeys."); - - Ok(()) -} - async fn fix_oauth_scope_names(services: &Services) -> Result { let db = &services.db; let userdeviceid_oauthsessioninfo = db["userdeviceid_oauthsessioninfo"].clone(); diff --git a/src/service/rooms/timeline/data.rs b/src/service/rooms/timeline/data.rs index a6c68198a..f0184533b 100644 --- a/src/service/rooms/timeline/data.rs +++ b/src/service/rooms/timeline/data.rs @@ -330,10 +330,10 @@ impl Data { .try_flatten_stream() } - pub(super) fn pdus_by_ts<'a>( + pub(super) fn pdus_by_timestamp<'a>( &'a self, room_id: &'a RoomId, - ts: MilliSecondsSinceUnixEpoch, + timestamp: MilliSecondsSinceUnixEpoch, dir: Direction, ) -> impl Stream> + Send + 'a { self.services @@ -341,8 +341,9 @@ impl Data { .get_shortroomid(room_id) .map_err(move |e| err!(Request(NotFound("Room {room_id:?} not found: {e:?}")))) .map_ok(move |shortroomid| { - let seek = - |shorteventid| roomts_key(&PduId { shortroomid, shorteventid }.into(), ts); + let seek = |shorteventid| { + roomts_key(&PduId { shortroomid, shorteventid }.into(), timestamp) + }; let keys = match dir { | Direction::Forward => self .roomts_pduid diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs index 1087dd8c1..15774c2e5 100644 --- a/src/service/rooms/timeline/mod.rs +++ b/src/service/rooms/timeline/mod.rs @@ -313,10 +313,10 @@ impl Service { pub fn pdus_by_timestamp<'a>( &'a self, room_id: &'a RoomId, - ts: MilliSecondsSinceUnixEpoch, + timestamp: MilliSecondsSinceUnixEpoch, dir: Direction, ) -> impl Stream> + Send + 'a { - self.db.pdus_by_ts(room_id, ts, dir) + self.db.pdus_by_timestamp(room_id, timestamp, dir) } pub async fn timestamp_index_ready(&self) -> bool { self.db.timestamp_index_ready().await }