Repository: libre-tube/LibreTube

Issue #6178: Issue Report for LibreTube Nightly Version 0.23.2
Created: 2024-06-23T19:39:03Z
Steps to reproduce

Use LibreTube with an authenticated instance to avoid frequent logouts.
Observe that the app automatically selects the server without choosing the proper instance, but somehow it's set in the right instance.
Navigate to the subscription page and notice that it only loads data from the past week.
Change the instance and try again, but the issue persists.
Use the app without an account, and it works fine.
Experience several crashes during use.

Expected behavior

The app should allow users to manually select the instance and authenticate properly.
The subscription page should load all data, not just data from the past week.
The app should function without crashes.
A mechanism to export or store crash reports should be available.

Actual behavior

The app automatically selects the server, sometimes without choosing the proper instance.
The subscription page only loads data from the past week.
Changing the instance does not resolve the issue.
The app works fine without an account.
Multiple crashes occur during use.
There is no way to export or store crash reports, only a bubble notification.

LibreTube version
0.23.2
Android version
android 13
Other details
android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{587e1bf u0 com.github.libretube.debug/com.github.libretube.services.OnlinePlayerService}
at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(Unknown Source:16)
at android.app.ActivityThread.throwRemoteServiceException(Unknown Source:62)
at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(Unknown Source:443)
at android.os.Handler.dispatchMessage(Unknown Source:19)
at android.os.Looper.loopOnce(Unknown Source:182)
at android.os.Looper.loop(Unknown Source:82)
at android.app.ActivityThread.main(Unknown Source:123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11)
at com.android.internal.os.ZygoteInit.main(Unknown Source:312)
Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
at android.app.ContextImpl.startServiceCommon(Unknown Source:219)
at android.app.ContextImpl.startForegroundService(Unknown Source:6)
at android.content.ContextWrapper.startForegroundService(Unknown Source:2)
at android.content.ContextWrapper.startForegroundService(Unknown Source:2)
at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(ContextCompat.java:1128)
at androidx.core.content.ContextCompat.startForegroundService(ContextCompat.java:700)
at com.github.libretube.helpers.BackgroundHelper.playOnBackground(BackgroundHelper.kt:47)
at com.github.libretube.helpers.BackgroundHelper.playOnBackground$default(BackgroundHelper.kt:24)
at com.github.libretube.helpers.NavigationHelper.navigateVideo(NavigationHelper.kt:62)
at com.github.libretube.helpers.NavigationHelper.navigateVideo$default(NavigationHelper.kt:49)
at com.github.libretube.ui.adapters.PlaylistAdapter.onBindViewHolder$lambda$4$lambda$0(PlaylistAdapter.kt:91)
at com.github.libretube.ui.adapters.PlaylistAdapter.$r8$lambda$r1boGDH3SvgPUcr1AhMY51B0yOU(Unknown Source:0)
at com.github.libretube.ui.adapters.PlaylistAdapter$$ExternalSyntheticLambda2.onClick(D8$$SyntheticClass:0)
at android.view.View.performClick(Unknown Source:17)
at android.view.View.performClickInternal(Unknown Source:3)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(Unknown Source:8)
at android.os.Handler.handleCallback(Unknown Source:2)
at android.os.Handler.dispatchMessage(Unknown Source:4)
... 6 more
Acknowledgements

 I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
 I have written a short but informative title.
 I will fill out all of the requested information in this form.

Duplicate issue #6260: ForegroundServiceDidNotStartInTimeException
Created: 2024-07-20T14:36:08Z
Steps to reproduce
Randomly happen when app is bring back in foreground.
Expected behavior
No exception raise.
Actual behavior
An exception is raise.
android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{cba7328 u0 com.github.libretube/.services.OnlinePlayerService c:com.github.libretube}
	at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2250)
	at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2221)
	at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2527)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8623)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1985)
	at android.app.ContextImpl.startForegroundService(ContextImpl.java:1939)
	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:832)
	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:832)
	at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(SourceFile:1)
	at androidx.room.Room.startForegroundService(SourceFile:7)
	at com.github.libretube.helpers.BackupHelper.playOnBackground(SourceFile:124)
	at com.github.libretube.helpers.BackupHelper.playOnBackground$default(SourceFile:34)
	at com.github.libretube.helpers.NavigationHelper.navigateVideo$default(SourceFile:73)
	at com.github.libretube.ui.adapters.VideosAdapter$$ExternalSyntheticLambda0.onClick(SourceFile:47)
	at android.view.View.performClick(View.java:7931)
	at android.view.View.performClickInternal(View.java:7908)
	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
	at android.view.View$PerformClick.run(View.java:30990)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	... 8 more

LibreTube version
0.24.0
Android version
Android 14
Other details
No response
Acknowledgements

 I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
 I have written a short but informative title.
 I will fill out all of the requested information in this form.

Closing comment (2024-07-20T14:42:01Z): Sorry, maybe a duplicate of #6178 #5929 #5770 #5433 #3106 and #1623.