ankidroid / ankidroid/Anki-Android

Migrate Card Template Editor to Rust backend for atomic notetype updates

Đang mở
#19,956 9 bình luận 0 reaction 1 người được giao Được @xenonnn4w nhận Xem trên GitHub
Anki Ecosystem Compatibility
Ngôn ngữ chính
Kotlin
Star
11.8k
Fork
2.9k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
171

Mô tả

Migrate the Card Template Editor to use the Rust backend's atomic `updateNotetype()` API instead of the current legacy approach that uses individual `addTemplate()` / `removeTemplate()` / `updateDict()` calls.

The current implementation has an atomicity issue where templates can be persisted to the database even if the final save fails (here)
https://github.com/ankidroid/Anki-Android/blob/0f4f87e486c56236087fbcec37c8929173e67989/AnkiDroid/src/main/java/com/ichi2/anki/CardTemplateNotetype.kt#L122-L141
This can cause data corruption with duplicate card types (e.g., "Card 2+", "Card 3++") if the user adds templates, encounters a validation error, and discards changes.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.