MarmadileManteater / FreeTubeAndroid

A soft fork of FreeTube which brings it to Android (formerly FreeTubeCordova)
GNU Affero General Public License v3.0
232 stars 6 forks source link

[Bug]: local storage deserialization error #67

Open Jadecraft4 opened 1 year ago

Jadecraft4 commented 1 year ago

Guidelines

Describe the bug

The app doesn't load when you add too many subscriptions.

To reproduce this you can:

  1. Import subscriptions with a lot of subscriptions or
  2. Subscribe to a lot of YouTubers
  3. Then when you close the app and open it again, it stops working and shows a blank screen.

Expected Behavior

I expect the app to load when I have a lot of youtubers, so load with everything and all the saved settings and subscriptions.

Issue Labels

causes crash, content not loading, visual bug

FreeTube Version

v.0.18.0 nightly-77

Operating System Version

Android version 12

Installation Method

.apk

Primary API used

Invidious API

Last Known Working FreeTube Version (If Any)

No response

Additional Information

I tried both APIs with no luck. I think something that might help tackle this issue is what the last person said in #2909 (I'm typing this on phone, so I don't want to type that.)

I mean no harm if I've typed or filled anything wrong.

Nightly Build

Jadecraft4 commented 1 year ago

Error 404

I found some errors in the console that might be helpful.

MarmadileManteater commented 1 year ago

Looking into this error, it looks like I might have been off-base with my original statement that this is related to an error from de-serializing local storage; however, the good news is that this seems to be related to the race condition I was describing here: https://github.com/MarmadileManteater/FreeTubeCordova/issues/79#issuecomment-1375714523. I just pushed up some commits which may resolve this issue. You can try out these changes by downloading the nightly available here: https://github.com/MarmadileManteater/FreeTubeCordova/actions/runs/3990278365

Jadecraft4 commented 1 year ago

Error 403 New Errors

Bad news about the new nightly, it doesn't allow me to import any subscriptions, and I can't watch any videos. It seems a little unstable because it crashes frequently. (And my phone says there's some bug in there but it did not specify.) I hope this helps!

MarmadileManteater commented 1 year ago

I have a few questions. What happens when you click the Import subscriptions button? Does it allow you to select a file, but fail to load or does it not let you select a file at all?

As far as watching videos goes, what Invidious instance displays in the General Settings section?

Also, when you say it crashes frequently, can you describe what is happening before the crash during the times you've experienced a crash? I'm trying to understand if there is a pattern.

Also, I'm sorry if I am bombarding you with questions. I am just trying to understand the problem better.

MarmadileManteater commented 1 year ago

I just pushed up some changes which might help with the crashes related to watching videos. You can download the nightly with these changes here: https://github.com/MarmadileManteater/FreeTubeCordova/actions/runs/3998526419 (Enabling the Disable notificiation when app in background setting under Cordova Settings may also help with some of the crashes.)

Jadecraft4 commented 1 year ago

Sorry for the late reply. What happens when I click the import subscriptions button is that it shows the files that you can import, but it crashes as soon as I press the button. So press the button, crash, but it shows the screen to import. When I choose something to import, it takes me to my home screen.

Here is the invidious instance: https://invidious.slipfox.xyz

Describing what happens before crashing, what happened is I would watch a video or import subscriptions. Guess that isn't much help. But I think it just crashes when I interact with an outside source, so the videos, or the things on my phone for import, but it was never when I would click to a different section, or open certain settings, which was in the app.

Hope this helps you understand what's happening, the only better way would be to make a video, but I am unsure if github supports that.

MarmadileManteater commented 1 year ago

You are 🧊cool with taking your time. I don't want to make you feel rushed. I do this for fun, so I definitely understand not being able to get back to someone immediately.

RusselNash10121 commented 1 year ago

I just pushed up some changes which might help with the crashes related to watching videos. You can download the nightly with these changes here: https://github.com/MarmadileManteater/FreeTubeCordova/actions/runs/3998526419 (Enabling the Disable notificiation when app in background setting under Cordova Settings may also help with some of the crashes.)

Hi, new user here.

LineageOS 20 (Android 13) with microg

FreeTubeCordova 0.18.0.98 from f-droid 136 subscriptions

Trying to import subscriptions from Newpipe and YT both crashed the app, both with changing settings beforehand and without. I tried the nightly you linked to. Disabling that setting in Cordova Settings indeed causes it not to crash anymore, however, importing Newpipe or YT subs simply doesn't work. The little popup notification that it may take some time to import shows up and goes away but nothing happens. I've tried it many times and there isn't any feedback or error message. Except once it did show some Invidious API errors but it almost always just silently fails to import anything.

RusselNash10121 commented 1 year ago

I'm not a dev or coder so forgive me if this is a stupid question but is it possible that this could be caused by the fact that I have one YT subscription in which the name of the channel has unusual characters / symbols in it?

Channel in question:

https://www.youtube.com/@user-fu1jy7jr3z

Jadecraft4 commented 1 year ago

Sorry about that gap of time, schoolwork got the best of me.

I had some things to say about the new nightly. (Although, I am unsure if you have fixed this recently.) I remember when I used it that the videos would load indefinitely. It would try to load, then it would show that image where it was like a broken website. Then it would try again, and do the same. But when I tried it now, it still doesn't load, but now it's like the circle thing.

The subscriptions don't work, but that may be obvious because you only tried to fix the videos.

Something I just found out, when loading the phone into the debug menu, it loads the video. But by itself it cannot. But I might need to test it more.

Error, Just Error ^Video Loaded

Error 202 Error 202 cont ^No Video

It's a little sensitive in when it will load a video, but I was able to get the errors for no video. Now that I think about it, when the video loaded, I had already had the debug menu open, but I opened the debug menu when the video couldn't load the next time. I think that's how that happened.

I hope this helps in any way!

MarmadileManteater commented 4 months ago

I apologize for letting this issue go dormant for a year. I'm not 100% certain, but the nightly might resolve your issues. It will 100% fix those cors errors, but it might also fix issues related to importing/exporting data or reading the databases from storage.