ankidroid / ankidroid/Anki-Android
Proposal: Support sync from any activity
- 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ả
> [!NOTE]
> This only intends for our syncing mechanism supports this use case, not implementation
> Even when implemented, this will not introduce a 'sync' button on every screen.
As part of a DeckPicker refactoring, I will need to move sync logic to a ViewModel.
In future, I would like to allow `MSG_DO_SYNC`, and addons to be able to sync from any screen, without requiring that the user opens the DeckPicker.
Much of DeckPicker's complexity stems from the following issues:
* What if the collection/backend is not usable
* What if the collection is syncing
* `CollectionManager.queue` uses `Dispatchers.IO.limitedParallelism(1)`, therefore blocking all future calls until syncing is completed, and the backend itself blocks access to the collection
* Handling `Message` from other screens in the app
Handling sync externally (via a `SyncManager`) would reduce complexity
### Issues/Considerations
These issues are currently present:
* What should `withCol` calls do? Block or cancel pending work?
* Some mutations may no longer be valid for the new collection
* Some 'valid' operations could be lost, whereas recovery is reasonable (`addNote`, assuming the note type still exists)
* What should the API do while syncing?
* What happens if the user is within a method with multiple `withCol` calls when syncing occurs
* `ReviewerViewModel.answerCardInternal` would want consideration
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.