feat: no longer implicitly set collection path when DB is used#21343
Open
david-allison wants to merge 2 commits into
Open
feat: no longer implicitly set collection path when DB is used#21343david-allison wants to merge 2 commits into
david-allison wants to merge 2 commits into
Conversation
cbe4d38 to
f86073c
Compare
Member
Yes, please do this. |
f86073c to
33b2d1a
Compare
5 tasks
CollectionManager to :anki-common
5 tasks
Breaking change, this was previously done on first collection access. Now this is set in AnkiDroidApp, and reading throws StorageNotConfiguredException beforehand. This contains a workaround for the OS-level bug: `SystemStorageException` if the exception is caught, it is explicitly rethrown. This is preparation for a full 'storage decision' screen during onboarding * Part of 19552 * Part of 13574 * Part of 20737 Assisted-by: Claude Fable 5
The decision now mirrors whether `getCurrentAnkiDroidDirectory` is usable or throws. The path is set during startup (`ensureCollectionPathSet`), so `Undecided` is only observable if startup storage initialization failed. This is now classified as an `InitializationError` and displayed in the app startup flow (with a TODO for 19552 to improve this). * Part of 19552 * Part of 13574 Assisted-by: Claude Fable 5
33b2d1a to
9ac0a08
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Assisted-by: Claude Fable 5
Purpose / Description
getCurrentAnkiDroidDirectoryvia moving storage initialization intostartup/SetupStorage.ktFixes
full(F-Droid/GitHub) releases users to grant theAll files accesspermission #13574Approach
storageDecision()based on whether the collection path is setstorageDecisionisn't setAnkiDroidAppgetCurrentAnkiDroidDirectoryno longer sets the collection path; throwingStorageNotConfiguredExceptionensureOpenInneralso throwsI maintained
SystemStorageExceptionfor the OS-level errors ifcontext.getExternalFilesDirreturns nullHow Has This Been Tested?
Unit tested
Checklist