From d2ec004ac3db7f627d15d4a0c8b4326556476c69 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 2 May 2022 20:57:29 +1000 Subject: [PATCH] Fix custom study applying previously-selected limit extend_limits() mutates deck, so we need to re-fetch it. Closes #1829 --- rslib/src/scheduler/filtered/custom_study.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rslib/src/scheduler/filtered/custom_study.rs b/rslib/src/scheduler/filtered/custom_study.rs index e3dcf042b..e6090a311 100644 --- a/rslib/src/scheduler/filtered/custom_study.rs +++ b/rslib/src/scheduler/filtered/custom_study.rs @@ -86,6 +86,7 @@ impl Collection { let today = self.current_due_day(0)?; self.extend_limits(today, self.usn()?, deck.id, delta, 0)?; if delta > 0 { + deck = self.storage.get_deck(deck.id)?.ok_or(AnkiError::NotFound)?; let original = deck.clone(); deck.normal_mut()?.extend_new = delta as u32; self.update_deck_inner(&mut deck, original, self.usn()?)?; @@ -96,6 +97,7 @@ impl Collection { let today = self.current_due_day(0)?; self.extend_limits(today, self.usn()?, deck.id, 0, delta)?; if delta > 0 { + deck = self.storage.get_deck(deck.id)?.ok_or(AnkiError::NotFound)?; let original = deck.clone(); deck.normal_mut()?.extend_review = delta as u32; self.update_deck_inner(&mut deck, original, self.usn()?)?;