-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Crash in AbstractFlashCardViewer.onCollectionLoaded() ArrayIndexOutOfBoundsException #4987
Comments
I already have a fix for item 1 - it's trivial (famous last words) |
Previewer also loses CardBrowser search state when it returns, it's a nest of little bugs up in there |
Video that shows: Second video that shows: |
First video shows the problem:
Need to post the PR but this is the after video:
|
I don't think this crash is related to the loader changes, it was probably introduced in the multi-select work |
Maybe I did not check that far since reproduction was so easy. Almost done with search term preservation in instance state and I'll PR the batch |
This was proposed as a fix for ankidroid#4987 but that issue is being fixed in a defense-in-depth fashion as this is a threading change and harder to reason about
- Previously Preview was always available, fixes ankidroid#4987 crash when no cards - Previously if you went to another Activity with an active search, it was forgotten
- Previously Preview was always available, fixes #4987 crash when no cards - Previously if you went to another Activity with an active search, it was forgotten
Collection loading logic was a bit disjointed between super- and sub-class, this puts it one place, and makes sure we won't load the collection unless we're going to actually create the activity This is the final part that Fixes ankidroid#4987
Collection loading logic was a bit disjointed between super- and sub-class, this puts it one place, and makes sure we won't load the collection unless we're going to actually create the activity This is the final part that Fixes #4987
The lifecycle changes in #4972 are the gift that keep on giving :-)
Reproduction Steps
Expected Results
This menu is already dynamic, so probably shouldn't have the Preview option there when there are no cards, but if it is there, it should toast "No cards to preview" or something.
Actual Result
Issue 1 - Crash when you hit "Preview" on the options menu in card browser when there are no cards.
Issue 2 - Also, the Card Browser Preview cycling is inconsistent. It starts with a cycle-left button but if you cycle right then back all the way left, the button is disabled. Should be disabled to start.
Issue 3 - Also the cycling right vs left to advance is probably a localization RTL issue (ha!)
This is from the pre-launch Firebase "Robo" test that Google Play conducts automatically on all releases, with 2.9alpha36
The "MATE 9" device here https://play.google.com/apps/publish/?account=5338425030304417978#PreLaunchReportPlace:p=com.ichi2.anki&appid=4973711737547064258&plrtab=CRASH&plrvc=20900136
09-20 07:16:50.650: E/MonitoringInstr(9942): Exception encountered by: com.ichi2.anki.Previewer@5936a01. Dumping thread state to outputs and pining for the fjords.
09-20 07:16:50.650: E/MonitoringInstr(9942): java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
09-20 07:16:50.650: E/MonitoringInstr(9942): at com.ichi2.anki.Previewer.onCollectionLoaded(Previewer.java:57)
09-20 07:16:50.650: E/MonitoringInstr(9942): at com.ichi2.anki.AnkiActivity.startLoadingCollection(AnkiActivity.java:253)
09-20 07:16:50.650: E/MonitoringInstr(9942): at com.ichi2.anki.AbstractFlashcardViewer.onCreate(AbstractFlashcardViewer.java:826)
09-20 07:16:50.650: E/MonitoringInstr(9942): at com.ichi2.anki.Previewer.onCreate(Previewer.java:48)
09-20 07:16:50.650: E/MonitoringInstr(9942): at android.app.Activity.performCreate(Activity.java:6910)
09-20 07:16:50.650: E/MonitoringInstr(9942): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
09-20 07:16:50.650: E/MonitoringInstr(9942): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:215)
The text was updated successfully, but these errors were encountered: