-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix: (ANR) Input Dispatching Timed Out in Split CardBrowser #20177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I don't feel I understand this issue enough. I suspect this is due to documentation on the issue. What does this mean:
❓ Do you have a more in-depth explanation for why this occurs?
Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/browser/CardBrowserFragment.kt Lines 641 to 658 in 8015ed6
The others:
don't seem like they would cause a problem [rather: maybe a minor issue, but not an ANR] Finally, I'm not sure I agree with the 150ms delay. This adds latency to the happy path and doesn't seem to be necessary. |
Actually in split mode, rapid scrolling/tapping triggers many selection events that repeatedly call
This is likely benign, but rapid interactions can increase calls and opens editor many times.
The 150ms delay is just a debounce, it can be reduced or removed. |
|
Why does scrolling trigger events? If this is onTap, then we should look into handing the TODO |
|
Agreed, scrolling shouldn’t trigger onTap, so the TODO is likely the right fix point. I’ll move this tap handling into the ViewModel and debounce editor loads to avoid repeated |
fix imports lexicographical sorting
fix topOffset update
9825166 to
ce4fc96
Compare
|
Please investigate. What's the cause of the problem? |
Purpose / Description
Describe the problem or feature and motivation
In Tablet/Chromebook when enabling split mode in CardBrower from Settings -> Developer Options and going to CardBrowser, and then scrolling through decks or clicking different decks multiple times causes ANR.
Fixes
Approach
How does this change address the problem?
I have created
cardSelectionJobinloadNoteEditorFragmentIfFragmentedwhich opens the split editor after 150ms delay so it prevents opening it multiple times when there are various clicks on the decks, so the final one only opens. It also ensures that the previouscardSelectionJobis cancelled before creating a newcardSelectionJob.How Has This Been Tested?
Have Tablet/Chromebook
Enable split mode in CardBrower from Settings -> Developer Options
Go to Cardbrowser
then scroll to decks and click them, It should remain responsive without blocking UI thread
I have tested on
Device: Medium Tablet
Android version: 13
API Level: 33
Shared Deck I used: 4000 Essential English Words (all books) [en-en]
Checklist
Please, go through these checks before submitting the PR.