Add 'Use default collection folder' recovery option for collection path mismatch#20362
Conversation
|
Important Maintainers: This PR contains Strings changes
|
|
I am not able get how you reproduced it, you edited the pref in |
|
@criticalAY On an Android 14 emulator with fullDebug (com.ichi2.anki.debug):
|
|
@david-allison, need you pov here, if this is the right way or not? |
david-allison
left a comment
There was a problem hiding this comment.
It would be very useful to add a test, potentially in androidTest here
At minimum, a @NeedsTest should be added.
LGTM other than the exception check
Sure! |
cbef9e3 to
3e8255a
Compare
david-allison
left a comment
There was a problem hiding this comment.
Sorry this sat, looks awesome!
|
@Giyutomioka-SS could you rebase and squash lets get it in |
I’m away from my laptop at the moment. Would you mind squash merging this PR? |
3e8255a to
b7b5918
Compare
|
Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR. Read more about updating strings on the wiki, |
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.