From 629db66018798cff63f01434823c08b6c5b53013 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 19 Aug 2024 13:59:37 +0300 Subject: [PATCH] fix(tasks): properly find current position when futures are involved --- src/tasks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks.rs b/src/tasks.rs index 6d9ba09..19ceac2 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -151,8 +151,8 @@ impl Tasks { pub(crate) fn len(&self) -> usize { self.tasks.len() } pub(crate) fn get_position(&self) -> Option { - self.history.get(&self.sender.pubkey()) - .and_then(|tree| tree.last()) + self.history_until(Timestamp::from(Timestamp::now() + Self::MAX_OFFSET)) + .last() .and_then(|e| referenced_events(e)) .cloned() }