From 60a1f0ab80d7e02145da84a72158047fd3960e6b Mon Sep 17 00:00:00 2001 From: user1823 <92206575+user1823@users.noreply.github.com> Date: Fri, 15 Aug 2025 11:22:23 +0530 Subject: [PATCH] Make simulator fill missing values of DR and decay too If a card has missing memory states, it will likely have missing DR and decay too. So, it makes sense to simultaneously update them as well. --- rslib/src/scheduler/fsrs/simulator.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rslib/src/scheduler/fsrs/simulator.rs b/rslib/src/scheduler/fsrs/simulator.rs index a26afda9c..50c84ebd6 100644 --- a/rslib/src/scheduler/fsrs/simulator.rs +++ b/rslib/src/scheduler/fsrs/simulator.rs @@ -143,8 +143,10 @@ impl Collection { for c in &mut cards { if is_included_card(c) && c.memory_state.is_none() { let original = c.clone(); - let new_state = self.compute_memory_state(c.id)?.state; - c.memory_state = new_state.map(Into::into); + let fsrs_data = self.compute_memory_state(c.id)?; + c.memory_state = fsrs_data.state.map(Into::into); + c.desired_retention = fsrs_data.desired_retention; + c.decay = fsrs_data.decay; self.update_card_inner(c, original, self.usn()?)?; } }