Skip to content

fix(Reviewer): Prevent double auto-advance trigger when answering manually#20289

Open
Ayush-Patel-56 wants to merge 1 commit intoankidroid:mainfrom
Ayush-Patel-56:fix-issue-20242
Open

fix(Reviewer): Prevent double auto-advance trigger when answering manually#20289
Ayush-Patel-56 wants to merge 1 commit intoankidroid:mainfrom
Ayush-Patel-56:fix-issue-20242

Conversation

@Ayush-Patel-56
Copy link
Contributor

@Ayush-Patel-56 Ayush-Patel-56 commented Feb 2, 2026

Purpose / Description

Fixes a race condition in the new study screen where manually answering a card while audio is playing causes the next card to auto-advance immediately.

Fixes

Approach

Temporarily disabled autoAdvance in ReviewerViewModel.onShowAnswer() during the manual transition. This prevents the "audio stopped" event from the previous card from triggering the auto-advance timer for the new card.

How Has This Been Tested?

Tested manually on an emulator with Auto Advance enabled (5s) and a deck with audio. Confirmed that answering quickly no longer causes double playback or immediate skipping.

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

@ShaanNarendran
Copy link
Contributor

Not a review but wanted to mention that the pr isn't following the standard template

@Ayush-Patel-56
Copy link
Contributor Author

Thanks @ShaanNarendran for informing, I had changed it to standard template now.

@BrayanDSO
Copy link
Member

I believe that the issue is fixed by #20055 (I couldn't reproduce it on that branch), which is a more definitive fix.

@BrayanDSO BrayanDSO added Blocked by dependency Currently blocked by some other dependent / related change and removed Needs Review labels Feb 6, 2026
@Ayush-Patel-56
Copy link
Contributor Author

Thanks for pointing that out! I also tested it manually and found that the issue is no longer reproducible on that branch. The mutex-based approach in #20055 properly handles the race condition.

Should I close this PR since #20055 provides a more comprehensive fix ?

@BrayanDSO
Copy link
Member

If it gets merged, it will automatically close this PR. No action needed for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocked by dependency Currently blocked by some other dependent / related change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Study Screen] Auto Advance plays audio twice and starts advancing cards immediately

3 participants

Comments