Background
Anki’s method for determining the last review time has two main issues:
- Performance: Querying the revlog is slow for batch operations.
- Accuracy: Estimations based on
dueandintervalfields can be incorrect, especially when modified manually or by add-ons.
Key Changes
- Schema Update:
- Added
last_review_time_secs(optionalint64) to the protobuf definition.
- Added
- Data Structures:
- Introduced
last_review_time: Option<TimestampSecs>to the RustCardstruct.
- Introduced
- Serialization:
- Integrated
last_review_timeinto read/write logic.
- Integrated
- Review Logic:
- Updated to store exact timestamp during card reviews.
- Calculation Logic:
- Functions now prioritize
last_review_timeover legacy methods.
- Functions now prioritize
Affected Components
- Card protobuf and Rust data structures
- Serialization/deserialization
- Browser table and scheduling logic
- Statistics
- Sync functionality
Benefits
- Improved Performance: Avoids costly revlog queries.
- Better Accuracy: Captures actual review timestamp.
- Backward Compatibility: Falls back to older methods if the new field is absent.




