Open aiwaverse opened 9 months ago
A little update: I thought this would fix #920, but after deeper testing, there appears to exist another possible crash situation on here, one that is proving a lot more awful to reproduce, same steps, but the first one I could consistently hit by typing fast, this one not so easy. This is the new error I'm finding
02-03 21:33:05.922 29596 29596 E AndroidRuntime: FATAL EXCEPTION: main
02-03 21:33:05.922 29596 29596 E AndroidRuntime: Process: org.joinmastodon.android.sk.debug, PID: 29596
02-03 21:33:05.922 29596 29596 E AndroidRuntime: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionEmojiViewHolder{4b4fead position=8 id=-1, oldPos=-1, pLpos:-1 no parent} me.grishka.appkit.views.UsableRecyclerView{199a770 VFED..... ........ 0,0-1080,147}, adapter:me.grishka.appkit.utils.MergeRecyclerAdapter@fe0b7, layout:androidx.recyclerview.widget.LinearLayoutManager@1c4a024, context:org.joinmastodon.android.MainActivity@95b578d
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:6159)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6342)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:287)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:344)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:360)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:367)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:398)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:942)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:226)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at android.os.Looper.loop(Looper.java:313)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8762)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
02-03 21:33:05.922 29596 29596 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Unsure how I handle PRs, so, I'll leave this one here.
The IllegalStateException was removed on 1.2.15: https://github.com/grishka/appkit/commit/9cacd1b11bd0ce4bc1419071a6aaf32965e86124, according to them, "No, it wasn't a good idea to throw that exception".
This fixes #920, which was, on personal experience, an awfully annoying bug to deal with it.
I have literally never done a PR on a project on my life, please let me know if I need to do something else.