fbarthelery / geekttrss

Geekttrss is an Tiny Tiny Rss reader application with transparent offline mode for the Android platform
GNU General Public License v3.0
52 stars 4 forks source link

Geekttrss crash (issue with reading JSON?) #16

Closed erazemk closed 1 year ago

erazemk commented 4 years ago

Geekttrss version: 1.5.2 (Github - using IzzyOnDroid's F-Droid repo) Android info: Xiaomi Redmi Note 3 - Android 10 (BlissROM 12.9)

What happened

When opening Geekttrss without any feeds, the app worked normally, but after reopening the app with feeds added externally Geekttrss crashes with the following log:

07-31 13:53:40.359 E/AndroidRuntime(10518): FATAL EXCEPTION: main
07-31 13:53:40.359 E/AndroidRuntime(10518): Process: com.geekorum.ttrss.free, PID: 10518
07-31 13:53:40.359 E/AndroidRuntime(10518): kotlinx.serialization.json.JsonDecodingException: Unexpected JSON token at offset 227: Expected '{, kind: CLASS'.
07-31 13:53:40.359 E/AndroidRuntime(10518):  JSON input: .....,"title":"Invidious","unread":null,"order_id":0},{"id":-1,"t.....
07-31 13:53:40.359 E/AndroidRuntime(10518):     at com.google.android.material.resources.TextAppearanceConfig.JsonDecodingException(TextAppearanceConfig.java:1)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at kotlinx.serialization.json.internal.JsonReader.fail(JsonReader.kt:1)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at kotlinx.serialization.json.internal.StreamingJsonInput.beginStructure(StreamingJsonInput.kt:9)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at com.geekorum.ttrss.webapi.model.ListContent$OwnSerializer.deserialize(BaseProtocol.kt:6)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at com.google.android.material.resources.TextAppearanceConfig.decodeSerializableValuePolymorphic(TextAppearanceConfig.java:19)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at kotlinx.serialization.json.internal.StreamingJsonInput.decodeSerializableValue(StreamingJsonInput.kt:1)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at kotlinx.serialization.json.internal.StreamingJsonInput.decodeSerializableElement(StreamingJsonInput.kt:1)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at com.geekorum.ttrss.webapi.model.ListResponsePayload$OwnSerializer.deserialize(BaseProtocol.kt:18)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at com.google.android.material.resources.TextAppearanceConfig.decodeSerializableValuePolymorphic(TextAppearanceConfig.java:19)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at kotlinx.serialization.json.internal.StreamingJsonInput.decodeSerializableValue(StreamingJsonInput.kt:1)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at com.google.android.material.resources.TextAppearanceConfig.decode(TextAppearanceConfig.java:1)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at kotlinx.serialization.json.Json.parse(Json.kt:3)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at kotlinx.serialization.json.Json$Default.parse(Json.kt:2)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at com.jakewharton.retrofit2.converter.kotlinx.serialization.DeserializationStrategyConverter.convert(DeserializationStrategyConverter.kt:4)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:22)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:1)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:13)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
07-31 13:53:40.359 E/AndroidRuntime(10518):     at java.lang.Thread.run(Thread.java:919)
07-31 13:53:40.363 I/DropBoxManagerService(1996): add tag=data_app_crash isTagEnabled=true flags=0x2
07-31 13:53:40.363 W/ActivityTaskManager(1996):   Force finishing activity com.geekorum.ttrss.free/com.geekorum.ttrss.articles_list.ArticleListActivity
07-31 13:53:40.380 I/Process (10518): Sending signal. PID: 10518 SIG: 9
07-31 13:53:40.472 D/ConnectivityService(1996): ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ TRACK_DEFAULT id=218, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10363] ], android.os.BinderProxy@dde22e0)
07-31 13:53:40.472 I/WindowManager(1996): WIN DEATH: Window{ea41fbd u0 com.geekorum.ttrss.free/com.geekorum.ttrss.articles_list.ArticleListActivity}
07-31 13:53:40.472 D/ConnectivityService(1996): releasing NetworkRequest [ TRACK_DEFAULT id=218, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10363] ] (release request)
07-31 13:53:40.474 D/ConnectivityService(1996): ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=215, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&FOREGROUND Uid: 10363] ], android.os.BinderProxy@6b3245e)
07-31 13:53:40.474 I/ActivityManager(1996): Process com.geekorum.ttrss.free (pid 10518) has died: fore TOP 
07-31 13:53:40.477 V/KeyguardUpdateMonitor(26128): onSubscriptionInfoChanged()
07-31 13:53:40.481 V/KeyguardUpdateMonitor(26128): SubInfo:{id=1, iccId=893864061[****] simSlotIndex=0 carrierId=1709 displayName=bob carrierName=bob nameSource=1 iconTint=-10839304 mNumber= dataRoaming=1 iconBitmap=android.graphics.Bitmap@fa40674 mcc 293 mnc 40mCountryIso=si isEmbedded false nativeAccessRules null cardString=893864061[****] cardId=-1 isOpportunistic false mGroupUUID=null mIsGroupDisabled=false profileClass=-1 ehplmns = [] hplmns = [29340] subscriptionType=0 mGroupOwner=null carrierConfigAccessRules=null}
07-31 13:53:40.482 W/ActivityManager(1996): Scheduling restart of crashed service com.geekorum.ttrss.free/androidx.work.impl.background.systemjob.SystemJobService in 1000ms
07-31 13:53:40.483 W/ActivityManager(1996): Scheduling restart of crashed service com.geekorum.ttrss.free/com.geekorum.ttrss.sync.ArticleSyncService in 11000ms

The log was taken with MatLog.

Updating the feeds worked fine with other TTRss apps and the feeds were successfully added using my instance's web interface.

The issue can't be recreated anymore (opening the app 10 minutes after the crash), the feeds load correctly now, so I don't know if I should report the issue or not.

fbarthelery commented 4 years ago

Thank you for reporting this. I'm trying to track down these json parsing issues.

Sometimes the api sends null instead of a default int value (0).

In this case the unread field should be 0 not "null". This seems to happens only when you just added a feed and it hasn't been initialized on the server yet, which explains why you can't reproduce it anymore.

fbarthelery commented 4 years ago

This should be fixed by dd6d02031e8353fd080bfc4caedc1be1a0780827