Add regression test preventing suspended-card rescheduling during FSRS updates
Context
#4453 fixed an issue where suspended cards could be rescheduled while their FSRS data was being updated.
Add a collection-level Rust regression test to protect this behavior through the relevant memory-state update path.
Scope
Construct a suspended review card that is eligible for an FSRS data update, and invoke the update with rescheduling requested.
Verify that:
- FSRS metadata can be recomputed as intended.
- The card’s scheduling fields are not changed by rescheduling.
- No rescheduled-review log entry is added.
Exercise the real collection-level update path and place the test in an appropriate existing #[cfg(test)] module. Preserve production behavior and avoid adding testing dependencies.
Assertion classification: Historical regression. Expected behavior: updating FSRS data with rescheduling requested must not change a suspended review card’s scheduling fields or add a rescheduled-review log entry. FSRS metadata may still be recomputed as intended, as established by the fix in
Acceptance criteria
- The fixture exercises an eligible suspended review card with rescheduling requested.
- The test verifies that scheduling fields remain unchanged by rescheduling.
- The test verifies that no rescheduled-review log entry is added.
- The test passes on the current implementation.
- The test fails when the suspended-card guard introduced by #4453, or an equivalent protection, is temporarily removed.
- The test is deterministic across supported CI platforms.
- The test name or failure message clearly identifies the protected behavior.
- The PR links the historical fix and documents the relevant before/after behavior.
Review
Request review from the Anki/FSRS reviewer pool: Isaac, Giacomo, Aidan, Expertium, Jakub, or another qualified contributor.
Source: ankitects/anki