flixclusiveorg / Flixclusive

A TV show and movie player application.
MIT License
391 stars 36 forks source link

Compose state handling exception #134

Open rhenwinch opened 2 weeks ago

rhenwinch commented 2 weeks ago

Steps to reproduce

Idk how to reproduce yet, but it seems to be randomly happening when loading media

Expected behavior

Should just proceed to player

Actual behavior

Crashes app

Crash logs (or stack trace)

2024-11-09 00:54:44.852  8930-8930  FlixclusiveLog          com.flixclusive.debug                E  java.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied (Ask Gemini)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotKt.readError(Snapshot.kt:2059)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotKt.current(Snapshot.kt:2402)
                                                                                                        at androidx.compose.runtime.DerivedSnapshotState$ResultRecord.readableHash(DerivedState.kt:144)
                                                                                                        at androidx.compose.runtime.DerivedSnapshotState$ResultRecord.isValid(DerivedState.kt:114)
                                                                                                        at androidx.compose.runtime.DerivedSnapshotState.currentRecord(DerivedState.kt:175)
                                                                                                        at androidx.compose.runtime.DerivedSnapshotState.getCurrentRecord(DerivedState.kt:279)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.recordInvalidation(SnapshotStateObserver.kt:597)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotStateObserver.drainChanges(SnapshotStateObserver.kt:71)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotStateObserver.access$drainChanges(SnapshotStateObserver.kt:43)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotStateObserver$applyObserver$1.invoke(SnapshotStateObserver.kt:50)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotStateObserver$applyObserver$1.invoke(SnapshotStateObserver.kt:48)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotKt.advanceGlobalSnapshot(Snapshot.kt:1945)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotKt.advanceGlobalSnapshot(Snapshot.kt:1960)
                                                                                                        at androidx.compose.runtime.snapshots.SnapshotKt.access$advanceGlobalSnapshot(Snapshot.kt:1)
                                                                                                        at androidx.compose.runtime.snapshots.Snapshot$Companion.sendApplyNotifications(Snapshot.kt:692)
                                                                                                        at androidx.compose.ui.platform.GlobalSnapshotManager$ensureStarted$1.invokeSuspend(GlobalSnapshotManager.android.kt:48)
                                                                                                        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
                                                                                                        at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
                                                                                                        at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
                                                                                                        at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:883)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                        at android.os.Looper.loop(Looper.java:214)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:7356)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
                                                                                                        Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.AndroidUiFrameClock@21c9dd3, StandaloneCoroutine{Cancelling}@277ad10, AndroidUiDispatcher@e0fc009]
2024-11-09 00:54:44.852  8930-8930  FlixclusiveLog          com.flixclusive.debug                E  Device: google Android SDK built for x86
                                                                                                    SDK: 29
                                                                                                    App version: 2.2.0-DEBUG

App version

2.2.0-DEBUG

Android version

SDK 29

Device

Emulator

Other details

Duplicate issue on discord

Acknowledgements

oathzed commented 1 week ago

It may have something to do with having a subtitle addon added. I wasn't getting this error previously, then I installed this addon (https://2ecbbd610840-opensubtitles.baby-beamup.club/configure/), and I got it randomly