Add 'Use default collection folder' recovery option for collection path mismatch#20362
Open
Giyutomioka-SS wants to merge 1 commit intoankidroid:mainfrom
Open
Add 'Use default collection folder' recovery option for collection path mismatch#20362Giyutomioka-SS wants to merge 1 commit intoankidroid:mainfrom
Giyutomioka-SS wants to merge 1 commit intoankidroid:mainfrom
Conversation
Contributor
|
Important Maintainers: This PR contains Strings changes
|
Contributor
|
I am not able get how you reproduced it, you edited the pref in |
Contributor
Author
|
@criticalAY On an Android 14 emulator with fullDebug (com.ichi2.anki.debug):
|
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.
Purpose / Description
When the stored collection path is wrong or no longer exists (e.g. legacy vs app-specific path), the "Error handling" screen had no way to fix it. This change adds a "Use default collection folder" option on that screen so the user can reset the path to the default and exit. On the next launch the app opens from the correct folder or creates a new collection there.
Fixes
Approach
When the database error dialog appears, we show a new "use default folder" option only if the current folder is not already the default one. If the user taps it, we close the collection, reset the folder path back to default, and exit the app. Next time the app opens, it uses the default folder. This follows the same close-reset-finish pattern already used elsewhere in the app.
How Has This Been Tested?
Reproduced the bug by setting a wrong path in prefs and a fake DB at that path on emulator.
Screen Recording
Screen_recording_20260225_172356.webm
Checklist
Please, go through these checks before submitting the PR.