Skip to content

fix(startup): handle when the user has not decided the storage type (App-Private/Public)#21290

Open
david-allison wants to merge 3 commits into
ankidroid:mainfrom
david-allison:entry-points-finish
Open

fix(startup): handle when the user has not decided the storage type (App-Private/Public)#21290
david-allison wants to merge 3 commits into
ankidroid:mainfrom
david-allison:entry-points-finish

Conversation

@david-allison

@david-allison david-allison commented Jun 21, 2026

Copy link
Copy Markdown
Member

Assisted-by: Claude Fable 5
implemented after a long discussion: comments, discussion and naming are mine

Purpose / Description

This is theoretical and works in order to get ExternalEntryPointsUndecidedStorageTest working.

I want to move AnkiDroid away from implicit collection creation in withCol into a deferred 'startup' path in order to remove complexity, allow for easy migration of CollectionHelper/CollectionManager to :anki-common, and better support for choosing a non-public AnkiDroid folder:

Fixes

Approach

If the storage location is undecided:

  • Redirect to IntentHandler if in the app
  • ⚠️ Crash the content-provider API, as this cannot be handled from the user's perspective
    • Optional follow-up: we may want to add a follow-up issue to handle this more gracefully on
    • Optional follow-up: do we want to add a localized exception message?

How Has This Been Tested?

This code exists to make a unit test pass

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

This is planned to be moved to anki-common, but not yet feasible

Assisted-by: Claude Fable 5
...by redirecting to IntentHandler

This fixes a bug in Reviewer and other entry points (see fixed test),
and hardens/standardizes other collection validation in the app

Assisted-by: Claude Fable 5 - implemented after a long discussion,
comments and naming are mine
@david-allison david-allison added the Review High Priority Request for high priority review label Jun 21, 2026
@david-allison david-allison changed the title fix(startup): handle when the user has not decided the storage type fix(startup): handle when the user has not decided the storage type (App-Private/Public) Jun 21, 2026
...by throwing, as a program using the API needs to surface this issue
to a user.

Assisted-by: Claude Fable 5 - implemented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Review High Priority Request for high priority review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant