Skip to content

Remove runBlocking calls in AbstractFlashcardViewer and BrowserColumnSelectionFragment#21300

Open
nikosavola wants to merge 2 commits into
ankidroid:mainfrom
nikosavola:fix-runblocking-todos
Open

Remove runBlocking calls in AbstractFlashcardViewer and BrowserColumnSelectionFragment#21300
nikosavola wants to merge 2 commits into
ankidroid:mainfrom
nikosavola:fix-runblocking-todos

Conversation

@nikosavola

Copy link
Copy Markdown
Contributor

Purpose / Description

Fixes two TODOs about runBlocking calls and refactors to the existing launchCatchingTask helper.

Approach

Remove fully blocking calls with the launchCatchingTask helper

How Has This Been Tested?

Ran ./gradlew :AnkiDroid:testPlayDebugUnitTest

Checklist

Please, go through these checks before submitting the PR.

  • 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

Fixes two TODOs about `runBlocking` calls in `AbstractFlashcardViewer` and `BrowserColumnSelectionFragment`

@criticalAY criticalAY left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@criticalAY criticalAY added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Jun 25, 2026
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt Outdated
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/browser/BrowserColumnSelectionFragment.kt Outdated
@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Jun 27, 2026
- Reverted `runBlocking` removal in `AbstractFlashcardViewer` as the class is in maintenance mode and will be removed soon.
- Wrapped `viewModel.previewColumnHeadings` with `withProgress` in `BrowserColumnSelectionFragment` to provide loading feedback and prevent potential crashes before content loads.
@nikosavola nikosavola requested a review from lukstbit June 29, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge New contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants