mirror of
https://github.com/ankitects/anki.git
synced 2026-09-10 10:59:28 -04:00
closes #3521 Previously when a card was moved between decks, it would be possible that the FSRS data could be cleared from the card so that it wouldn't display when the card stats were shown. With this pr the memory state is attempted to be calculated when the stats screen is opened if the state doesn't already exist. ## Testing steps 1. Create and review a card 2. Move it to a different deck 3. This card will now lack a memory state 4. Open the card stats 5. You will see the memory state there. ## Drawbacks Notably means that the cards in the deck browser will still be missing the memory state related columns after they're moved. It also introduces an operation that modifies the card to the card_info function which seems like a weird thing to do, although a similar thing is also done when the user try's to simulate cards which are missing memory states. This changed is predicated on what Dae said in the aformentioned issue: > Deck changing is a common operation, and we don't want expensive calculations every time it happens. > > Keeping the old memory state would require some extra flag so we know to discard it at study time. And it would mean your stats are still wrong - they'd just contain stale data, instead of missing data. However with the memory state speed improvements introduced in #4335. Maybe it is worth calculating the state when the cards are moved decks rather than in this way?