java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time. at androidx.room.RoomDatabase.assertNotMainThread(RoomDatabase.java:30) at androidx.room.RoomDatabase.beginTransaction(RoomDatabase.java:1) at com.github.libretube.db.dao.WatchHistoryDao_Impl.delete(WatchHistoryDao_Impl.java:8) at com.github.libretube.ui.adapters.WatchHistoryAdapter.removeFromWatchHistory(WatchHistoryAdapter.kt:17) at com.github.libretube.ui.adapters.WatchHistoryAdapter$$ExternalSyntheticLambda1.onClick(R8$$SyntheticClass:10) at android.view.View.performClick(View.java:7506) at android.view.View.performClickInternal(View.java:7483) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:29335) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7893) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Acknowledgements
[x] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
[X] I have written a short but informative title.
[X] I will fill out all of the requested information in this form.
Steps to reproduce
Expected behavior
The video gets deleted
Actual behavior
The app crashes
LibreTube version
0.8.0
Android version
Android 13
Other details
Error log:
java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time. at androidx.room.RoomDatabase.assertNotMainThread(RoomDatabase.java:30) at androidx.room.RoomDatabase.beginTransaction(RoomDatabase.java:1) at com.github.libretube.db.dao.WatchHistoryDao_Impl.delete(WatchHistoryDao_Impl.java:8) at com.github.libretube.ui.adapters.WatchHistoryAdapter.removeFromWatchHistory(WatchHistoryAdapter.kt:17) at com.github.libretube.ui.adapters.WatchHistoryAdapter$$ExternalSyntheticLambda1.onClick(R8$$SyntheticClass:10) at android.view.View.performClick(View.java:7506) at android.view.View.performClickInternal(View.java:7483) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:29335) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7893) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Acknowledgements