From f9c9c8c2ff0919841e269c5879e3c4375bc5a274 Mon Sep 17 00:00:00 2001 From: mcostn Date: Wed, 3 Sep 2025 20:52:19 +0300 Subject: [PATCH 1/2] Fix undo queue being cleared on every error This only discards the undo and study queues when the error is not a FilteredDeckError --- rslib/src/collection/transact.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rslib/src/collection/transact.rs b/rslib/src/collection/transact.rs index 2d98b6679..8f998594a 100644 --- a/rslib/src/collection/transact.rs +++ b/rslib/src/collection/transact.rs @@ -44,7 +44,10 @@ impl Collection { }) // roll back on error .or_else(|err| { - self.discard_undo_and_study_queues(); + // not necesarry to discard queues for all errors + if !matches!(err, AnkiError::FilteredDeckError { .. }) { + self.discard_undo_and_study_queues(); + } if autocommit { self.storage.rollback_trx()?; } else { From b2791f92a4f2ad265b05cf18e1e40a03b07b1811 Mon Sep 17 00:00:00 2001 From: mcostn Date: Wed, 3 Sep 2025 21:18:39 +0300 Subject: [PATCH 2/2] Update CONTRIBUTORS --- CONTRIBUTORS | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 70032a23c..93a0cdfe6 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -241,6 +241,7 @@ Siyuan Mattuwu Yan Lee Doughty <32392044+leedoughty@users.noreply.github.com> memchr Aldlss +mcostn ********************