mastodon / mastodon-android

Official Android app for Mastodon
https://app.joinmastodon.org/android
GNU General Public License v3.0
1.62k stars 249 forks source link

Crash while scrolling in server emojis #781

Open femdiya opened 4 months ago

femdiya commented 4 months ago

App version 2.4.0, github release, Android 14 AOSP (PixelOS) I was replying to a post, scrolling in server's emojis and this crash happened. Logs: https://bin.kv2.dev/~65db4aa05de7ed6bfdbe32c3

time: 1708870300525
msg: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 37(offset:37).state:94 me.grishka.appkit.views.UsableRecyclerView{986e3c9 VFED..... ........ 0,0-1080,108}, adapter:m0.f@b972c7, layout:androidx.recyclerview.widget.m@cd8b0f4, context:org.joinmastodon.android.MainActivity@ee5e01d
stacktrace: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 37(offset:37).state:94 me.grishka.appkit.views.UsableRecyclerView{986e3c9 VFED..... ........ 0,0-1080,108}, adapter:m0.f@b972c7, layout:androidx.recyclerview.widget.m@cd8b0f4, context:org.joinmastodon.android.MainActivity@ee5e01d
    at androidx.recyclerview.widget.RecyclerView$v.I(SourceFile:297)
    at androidx.recyclerview.widget.h.i(SourceFile:15)
    at androidx.recyclerview.widget.h.c(SourceFile:16)
    at androidx.recyclerview.widget.h.d(SourceFile:23)
    at androidx.recyclerview.widget.h.g(SourceFile:4)
    at androidx.recyclerview.widget.h.run(SourceFile:65)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8248)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
grishka commented 4 months ago

Are you using the Google Play version or the one from GitHub releases? (I need to know this to deobfuscate the stack trace)

femdiya commented 4 months ago

@grishka github release

grishka commented 4 months ago

hmm

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 37(offset:37).state:94 me.grishka.appkit.views.UsableRecyclerView{986e3c9 VFED..... ........ 0,0-1080,108}, adapter:me.grishka.appkit.utils.MergeRecyclerAdapter@b972c7, layout:androidx.recyclerview.widget.LinearLayoutManager@cd8b0f4, context:org.joinmastodon.android.MainActivity@ee5e01d
    at androidx.recyclerview.widget.RecyclerView$Recycler.androidx.recyclerview.widget.RecyclerView$ViewHolder tryGetViewHolderForPositionByDeadline(int,boolean,long)(SourceFile:297)
    at androidx.recyclerview.widget.GapWorker.androidx.recyclerview.widget.RecyclerView$ViewHolder prefetchPositionWithDeadline(androidx.recyclerview.widget.RecyclerView,int,long)(SourceFile:15)
    at androidx.recyclerview.widget.GapWorker.void flushTaskWithDeadline(androidx.recyclerview.widget.GapWorker$Task,long)(SourceFile:16)
    at androidx.recyclerview.widget.GapWorker.void flushTasksWithDeadline(long)(SourceFile:23)
    at androidx.recyclerview.widget.GapWorker.void prefetch(long)(SourceFile:4)
    at androidx.recyclerview.widget.GapWorker.void run()(SourceFile:65)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8248)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
femdiya commented 4 months ago

did you experience the crash too?

grishka commented 4 months ago

No I never did, I just deobfuscated your log. I need to add toString() to MergeRecyclerAdapter to make these kinds of crashes easier to debug in the future.

femdiya commented 4 months ago

sooo, should I wait for new release?