bennettpeter / android-MythTV-Leanfront

:tv: MythTV Android TV frontend
GNU General Public License v3.0
45 stars 9 forks source link

Leanfront stops refreshing recordings after some point in time #93

Closed faginbagin closed 6 months ago

faginbagin commented 6 months ago

I haven't figured out what causes this to happen, but when it does. Leanfront stops updating the recordings. I am running the latest version on a Fire TV Stick 4K, v0-481-g2f4a197... The firetv is running Fire OS 6.7.0.1 (NS6701/4985). A log that covers the time from 2/19 00:39 to 02/21 13:25 is available in my google drive: https://drive.google.com/drive/folders/1rR15WUvZ_k_dYUVEHlcVdVIcSW_B_73O?usp=sharing

This problem is a regression from the previous version I was running: 20220802-leanfront-release-v0-365-ge5295c8.apk

The first several lines are from what looks like a leanfront crash, which may or may not be related to an earlier instance of the problem. It has happened a few times since I upgraded to the Amazon Appstore version. Then the log looks like I restarted the firetv around 2-20 00:27. I have restarted the stick a few times to work around the problem. I think the last time I hit the problem was sometime last night 02-20, but it didn't stop me from watching what I wanted. This morning, some time after 02-21 10:18, I wanted to watch last night's news, but couldn't because it wasn't listed. The file for that recording was 1041_20240221040000.ts, and the title was "Local 4 News at 11".

I tried the "Refresh Lists" tool but nothing happened. I tried exiting by pressing return until I hit the home screen and then going back in, still nothing. I confirmed I could play a video in my Recently Viewed list which I think rules out a network problem. What did work was to go to Manage Installed Apps, leanfront, and then force stop and clear cache. It looks like I restarted leanfront around 02-21 10:29, according to mythbackend.log. Several seconds after restarting leanfront, it finally refreshed the recordings.

I had other things going on and didn't capture 0221-fail-to-refresh.log until 02-21 13;25. I hope it gives you what you need to debug this problem. Let me know what else I can do to help.

bennettpeter commented 6 months ago

There is a new setting for frequency of refresh Advanced -> Number of minutes between backend refreshes. This defaults to 60 minutes, which is the value that was used before, so that should not cause the problem. Clicking on "Refresh lists" should refresh everything.

Is there no response to refresh lists at all? The screen should flicker when the refresh is complete. It should show a spinning progress bar if the refresh takes longer than 1 second.

Possibly the refresh is throwing an exception.

There is nothing useful in the log you shared. Android removes messages it thinks are unimportant from the log soon after it writes them. Although the log goes back a long time it is incomplete. The best is to start logcat, then while logcat is running, hit refresh lists.

There is a new setting in leanfront in Advanced to set the auto refresh interval, which normally is 60 minutes. I don't know if this may have caused the problem.

faginbagin commented 6 months ago

I have waited at least a minute for something to happen after clicking on Refresh Lists (and the spinner keeps on spinning the whole time. And that's after waiting a minute for the recordings to update naturally after the firetv and leanfront have been asleep for hours. Maybe I'm too impatient, but I don't recall it taking that long with the previous version I had. When nothing happens after a minute, I get impatient and experiment with work arounds. I can't swear to it, but I think have seen a screen flicker without any substantive change to the recordings when I've got the problem. Recordings deleted the day before are still listed and none of the new recordings are shown.

FWIW, I've got 413 recordings as of now, and about 7450 videos that haven't changed in ages.

I'll start up logcat now. I forgot to mention that I did change the auto refresh interval to 28 minutes. More later...

bennettpeter commented 6 months ago

I found some serious bugs in refresh, introduced recently. I will get a new version out once I have retested the changes.

faginbagin commented 6 months ago

Thanks for the news. Any thoughts on what can trigger them? Anything a human can do, for example? It might help me to confirm these are at the root of my problems and help with testing?

faginbagin commented 6 months ago

I should also add, I haven't seen the problem since I started logcat in the background. The log file is now up to 629 MB.

bennettpeter commented 6 months ago

You can shut down the logcat, I think I have found the bug. The refresh should work on the main screen (the one with recordings and videos), but there is an endless loop if you refresh on a screen for a recording group or video directory. I hope to release the new version on Monday. If you want to test it pre-release, send me your amazon login email address and I will add you as a tester, then you can install the test version from amazon. The amazon store will upgrade your fire stick to the test version.

bennettpeter commented 6 months ago

Comments from the fix:

Fix bugs in refresh logic.

1. Fetch video service infinite loop when refreshing videos or
   recordings.
2. Failure to pass results of refresh to list of videos or recordings.
3. Failure to terminate progress spinner when refresh is complete.
faginbagin commented 6 months ago

Thanks for the update. That makes sense, because I usually leave leanfront open in a recording group and choose to refresh in the group. It might also explain why I'm the first to report this a couple of weeks after the release. Perhaps most users sit at the all recording screen most of the time?

bennettpeter commented 6 months ago

Fix is now live in v0-487-g6d06cf7-m1.2.1-2-gc3114cd837

faginbagin commented 6 months ago

Thanks!