lock the getter instead ??? c/o M
Some checks failed
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 1s
Rust Checks / Clippy (push) Failing after 24s
Rust Checks / Cargo Test (push) Failing after 25s

This commit is contained in:
Jacob Taylor 2025-06-18 16:57:19 -07:00
parent cd29b06221
commit 660c260b8d
3 changed files with 3 additions and 2 deletions

View file

@ -141,7 +141,7 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu(
let extremities: Vec<_> = self let extremities: Vec<_> = self
.services .services
.state .state
.get_forward_extremities(room_id) .get_forward_extremities(room_id, &state_lock)
.map(ToOwned::to_owned) .map(ToOwned::to_owned)
.ready_filter(|event_id| { .ready_filter(|event_id| {
// Remove any that are referenced by this incoming event's prev_events // Remove any that are referenced by this incoming event's prev_events

View file

@ -384,6 +384,7 @@ impl Service {
pub fn get_forward_extremities<'a>( pub fn get_forward_extremities<'a>(
&'a self, &'a self,
room_id: &'a RoomId, room_id: &'a RoomId,
_state_lock: &'a RoomMutexGuard,
) -> impl Stream<Item = &EventId> + Send + '_ { ) -> impl Stream<Item = &EventId> + Send + '_ {
let prefix = (room_id, Interfix); let prefix = (room_id, Interfix);

View file

@ -654,7 +654,7 @@ impl Service {
let prev_events: Vec<OwnedEventId> = self let prev_events: Vec<OwnedEventId> = self
.services .services
.state .state
.get_forward_extremities(room_id) .get_forward_extremities(room_id, _mutex_lock)
.take(20) .take(20)
.map(Into::into) .map(Into::into)
.collect() .collect()