red-coracle / episodes

Keep track of which television show episodes you've seen!
GNU General Public License v3.0
42 stars 10 forks source link

App will "get stuck" while refreshing some series #101

Open robinpaulson opened 1 year ago

robinpaulson commented 1 year ago

For example, it refreshes the first ten series in my list, then hangs (I left it for 1hr) on "American horror story". When I remove that from the list and refresh the shows again, it hangs on "ashes to ashes". Removing that, refreshing again makes it hang on "Babylon Berlin".

red-coracle commented 1 year ago

Is this on v0.16.0? I tried adding all three shows on a fresh install and it worked for me.

robinpaulson commented 1 year ago

Yes, latest version.

robinpaulson commented 1 year ago

After removing them, i readded and refreshed again. It hangs st the same point.

red-coracle commented 1 year ago

Are you able to upload a backup file and/or the ADB log output from when you refresh?

robinpaulson commented 1 year ago

FATAL EXCEPTION: main Process: com.redcoracle.episodes, PID: 12220 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:537) at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:526) at r3.e.(SourceFile:8) at com.redcoracle.episodes.b$c.(Unknown Source:11) at com.redcoracle.episodes.b.y(SourceFile:12) at androidx.fragment.app.i0.a(SourceFile:42) at androidx.fragment.app.i0.k(SourceFile:140) at androidx.fragment.app.b0.M(SourceFile:58) at androidx.fragment.app.b0.t(SourceFile:34) at androidx.fragment.app.t.onStart(SourceFile:34) at f.h.onStart(Unknown Source:0) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391) at android.app.Activity.performStart(Activity.java:7165) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2975) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6718) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

robinpaulson commented 1 year ago

I get this, or similar, a lot. android.database.sqlite.SQLiteException: near "WHERE": syntax error (code 1 SQLITE_ERROR): , while compiling: UPDATE episodes SET tmdb_id=?,overview=?,episode_number=?,show_id=?,name=?,season_number=?, WHERE _id=12995

robinpaulson commented 1 year ago

Also this: (1) near "WHERE": syntax error

robinpaulson commented 1 year ago

I get the last two errors for each of the problematic shows listed above. I assume "_id" matches those in the tmdb db. 12995, 12581, 11215. I can't tell what about those shows is causing the failure though

robinpaulson commented 1 year ago

I wonder if it's related to the first_aired column being empty? The hangs appear to happen when that's the case. Possibly

robinpaulson commented 1 year ago

These shows also cause the app to hang: American horror story Ashes to ashes Babylon Berlin Black books Black mirror Bottom Coupling Fargo Father ted Friday night dinner I'm Alan partridge Jonathan creek Life on mars Lost Malcolm in the middle Mr robot Oliver Stone's untold history of the united states Party down Person of interest Roots Seinfeld

They all appear to have "specials" with no info or date.

robinpaulson commented 1 year ago

I can provide more info, let me know which

red-coracle commented 1 year ago

Sorry, my time has been in short supply as of late. I think there are potentially two issues here: the first stacktrace is about a null context when getting the shared preferences, while the SQL error is because there's a comma directly before the WHERE keyword. I've not been able to reproduce either issue though. I've tried adding those shows to a new 0.16.0 install as well as upgrading from 0.15.1 and not had any errors.

robinpaulson commented 1 year ago

I could provide my db export, but don't think I can upload it here?

robinpaulson commented 1 year ago

I can email it, if you provide an address?

red-coracle commented 1 year ago

I'll add you to a temporary private repo where you can upload it.

robinpaulson commented 1 year ago

I couldn't get that to work. I only have access to GitHub via an android app, so no repo interactions beyond issues.

WingerathM commented 1 year ago

I can confirm the issue and expand on the list of "problematic" series: A droid story American Horror Story Arrow Ayakashi Triangle Dr. Stone Hawaii-Five O Lando Star Trek: Discovery Star Trek: Picard Star Trek: Strange New Worlds Star Wars: The clone Wars Supernatural The Acolyte The Expanse Titans

It seems like it's not only "specials" without date, but also regular episodes if they have no airing date (yet).

red-coracle commented 10 months ago

@WingerathM, are you able to upload a copy of a database exhibiting the behaviour? I have several of those shows added myself and haven't encountered issues.

robin-paulson commented 7 months ago

episodes_2024-01-22_1505.db.zip Here's a copy of my db, as exported via the app.

robin-paulson commented 7 months ago

It seems like it's not only "specials" without date, but also regular episodes if they have no airing date (yet).

Yes, I see this behaviour too. "Orphan Black: Echoes" fails; it has no dates yet

robin-paulson commented 5 months ago

Hi, do you think you'll get a chance to look at the db export I posted? Thanks

robin-paulson commented 5 months ago

I opened the db export in an sqlite viewer, to see if there were any obvious inconsistencies which might cause the hang. This is what I found:

robin-paulson commented 5 months ago

I'm going to edit the db, then import it into episodes, see what happens. First step, I'll remove NULL from the language column,

robin-paulson commented 5 months ago

The episodes without a language are the same as those which don't have a tvdb_id.