Skip to content

fix(study-screen): streamline actions#20055

Merged
lukstbit merged 2 commits intoankidroid:mainfrom
BrayanDSO:ref/everything-in-one-place
Apr 5, 2026
Merged

fix(study-screen): streamline actions#20055
lukstbit merged 2 commits intoankidroid:mainfrom
BrayanDSO:ref/everything-in-one-place

Conversation

@BrayanDSO
Copy link
Copy Markdown
Member

@BrayanDSO BrayanDSO commented Jan 8, 2026

Purpose / Description

Doing everything asynchronously and in parallel lead to some concurrency issues, like #19641

Fixes

Approach

use executeAction as the single source of actions from the fragment

that way, most uses of launchCatchingIO got removed, so actions won't run parallelly

then use a mutex to make actions run in order inside executeAction

As executeAction is supposed to be used only by the View, not in the ViewModel internal logic, it being "synchronic" is alright, I think

How Has This Been Tested?

Emulator 31 + an auto clicker

Screen_recording_20260108_154243.mp4

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

@BrayanDSO BrayanDSO added Needs Review Blocked by dependency Currently blocked by some other dependent / related change labels Jan 8, 2026
@BrayanDSO BrayanDSO force-pushed the ref/everything-in-one-place branch from 6b51e4f to 6f5893a Compare January 9, 2026 00:15
@BrayanDSO BrayanDSO force-pushed the ref/everything-in-one-place branch from 6f5893a to 657b6cb Compare February 5, 2026 19:06
@BrayanDSO BrayanDSO removed Blocked by dependency Currently blocked by some other dependent / related change Has Conflicts labels Feb 5, 2026
@BrayanDSO BrayanDSO marked this pull request as draft February 6, 2026 09:02
@BrayanDSO BrayanDSO force-pushed the ref/everything-in-one-place branch from 657b6cb to 7d04854 Compare February 6, 2026 09:06
@BrayanDSO BrayanDSO marked this pull request as ready for review February 6, 2026 09:08
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

This doesn't look exception-safe.

The rest looks great!

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/ReviewerViewModel.kt Outdated
@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels Mar 4, 2026
@BrayanDSO BrayanDSO force-pushed the ref/everything-in-one-place branch from 7d04854 to 18bf42d Compare March 11, 2026 09:19
@BrayanDSO BrayanDSO added Needs Review and removed Needs Author Reply Waiting for a reply from the original author labels Mar 11, 2026
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

LGTM, cheers!

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Mar 11, 2026
Comment thread AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/ReviewerViewModel.kt Outdated
@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Apr 4, 2026
use `executeAction` as the single point of actions from the fragment

that way, most uses of launchCatchingIO got removed, so actions won't run parallelly

then use a mutex to make actions run in order inside `executeAction`

fixes 19641
removes a call of launchCatchingIO
@BrayanDSO BrayanDSO force-pushed the ref/everything-in-one-place branch from 18bf42d to b4df43e Compare April 5, 2026 12:35
@BrayanDSO BrayanDSO removed the Needs Author Reply Waiting for a reply from the original author label Apr 5, 2026
@david-allison david-allison requested a review from lukstbit April 5, 2026 12:51
@lukstbit lukstbit removed the Needs Second Approval Has one approval, one more approval to merge label Apr 5, 2026
@lukstbit lukstbit added the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Apr 5, 2026
@lukstbit lukstbit added this pull request to the merge queue Apr 5, 2026
Merged via the queue into ankidroid:main with commit b9ab20d Apr 5, 2026
15 checks passed
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Apr 5, 2026
@github-actions github-actions Bot added this to the 2.24 release milestone Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New study screen] Card was modified error when tapping the answer buttons quickly

3 participants