Anki/rslib/src/scheduler
Damien Elmes 62223499c4 fix errors when undoing/redoing after a queue-invalidating operation
There were a few issues going on here:

- If some operation had invalidated the queues, they were subsequently
recreated with a call to .get_queues() in the undo handling code. This
could happen after the changes to the card had already been reverted,
leading to a queue state that didn't match our expectations.
- More generally, it's not safe to assume our mutations will apply
cleanly after the queue has been rebuilt. The next card will vary
depending on the number of remaining cards when interspersing cards of
different types, and a queue-invalidating operation will have changed
the learning cutoff.

So rather than rebuilding the queues on demand, we now check that they
already exist, and were created at the time we expect. If not, we
invalidate them and skip applying the mutations, and a subsequent
refresh of the UI should rebuild the queues correctly.

As part of this change, the cutoff snapshot has been moved into the
normal answer update object.

One possible downside here is that adding a note during review may cause
a newly due learning card to appear when undoing a different review.
If this proves to be a problem, we could potentially note down the
learning cutoff and apply it when queues are rebuilt later.
2021-08-22 15:32:46 +10:00
..
answering support limiting interday learning cards by review limit again 2021-08-22 15:32:46 +10:00
filtered Adjust search syntax for filtered deck presets 2021-05-17 12:14:02 +02:00
queue fix errors when undoing/redoing after a queue-invalidating operation 2021-08-22 15:32:46 +10:00
states filtered decks w/ scheduling disabled in v3 now log reviews 2021-08-19 20:25:29 +10:00
bury_and_suspend.rs in/out -> request/response 2021-06-20 15:49:20 +10:00
congrats.rs fallback on default deck in congrats screen 2021-08-04 12:57:46 +10:00
learning.rs deckconf -> deckconfig 2021-04-20 21:54:24 +10:00
mod.rs cache scheduling info 2021-04-05 17:09:53 +10:00
new.rs allow repositioning of new cards while suspended 2021-08-15 15:06:25 +10:00
reviews.rs scheduler: use deck config's initial ease in set_due_date 2021-07-16 12:33:15 +10:00
timespan.rs tidy up Rust imports 2021-04-18 18:38:54 +10:00
timing.rs suppress some tests around the daily rollover 2021-05-24 14:18:07 +10:00
upgrade.rs DeckConfId -> DeckConfigId 2021-04-28 21:09:26 +10:00