Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException with yarr's Fever API implementation #867

Open
valpackett opened this issue Nov 11, 2024 · 0 comments
Open

NullPointerException with yarr's Fever API implementation #867

valpackett opened this issue Nov 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@valpackett
Copy link

(Current version on F-Droid, 0.10.1)

When connecting to yarr's Fever endpoint no articles show up.. and no error either because the error toast fails with an exception as well. logcat:

1731357576.769 10425   965 26827 I RLog    : doWork:
1731357576.790 10425   965   965 I RLog    : pullImportant: accountId: 2, isStarred: false, isUnread: false
1731357576.887 10425   965 25481 E RLog    : On sync exception: null
1731357576.887 10425   965 25481 E RLog    : java.lang.NullPointerException
1731357576.887 10425   965 25481 E RLog    :  at me.ash.reader.domain.service.FeverRssService$sync$2.invokeSuspend(FeverRssService.kt:1493)
1731357576.887 10425   965 25481 E RLog    :  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
1731357576.887 10425   965 25481 E RLog    :  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:111)
1731357576.887 10425   965 25481 E RLog    :  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:96)
1731357576.889  1000  2843  6871 I NotificationService: cancelToast pkg=me.ash.reader token=android.os.BinderProxy@c6d2cf8
1731357576.889  1000  2843  6871 W NotificationService: Toast already cancelled. pkg=me.ash.reader token=android.os.BinderProxy@c6d2cf8
1731357576.890 10425   965  1005 E WM-WorkerWrapper: Work [ id=3af45b58-efee-4c88-b917-bafc9099c053, tags={ me.ash.reader.domain.service.SyncWorker, ReadYou } ] failed because it threw an exception/error
1731357576.890 10425   965  1005 E WM-WorkerWrapper: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: You must either set a text or a view
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at androidx.work.impl.utils.futures.AbstractFuture.getDoneValue$1(AbstractFuture.java:21)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at androidx.work.impl.utils.futures.AbstractFuture.get(AbstractFuture.java:67)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at androidx.work.impl.WorkerWrapper$2.run(WorkerWrapper.java:7)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:3)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at java.lang.Thread.run(Thread.java:1012)
1731357576.890 10425   965  1005 E WM-WorkerWrapper: Caused by: java.lang.IllegalStateException: You must either set a text or a view
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at com.android.internal.util.Preconditions.checkState(Preconditions.java:215)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at android.widget.Toast.show(Toast.java:199)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at me.ash.reader.ui.ext.ContextExtKt.showToast(ContextExt.kt:21)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at me.ash.reader.ui.ext.ContextExtKt.showToast$default(ContextExt.kt:6)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at me.ash.reader.domain.service.FeverRssService$sync$2$8.invokeSuspend(FeverRssService.kt:25)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:111)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at android.os.Handler.handleCallback(Handler.java:1000)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at android.os.Handler.dispatchMessage(Handler.java:104)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at android.os.Looper.loopOnce(Looper.java:242)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at android.os.Looper.loop(Looper.java:362)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at android.app.ActivityThread.main(ActivityThread.java:8448)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at java.lang.reflect.Method.invoke(Native Method)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
1731357576.890 10425   965  1005 E WM-WorkerWrapper:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
1731357576.892 10425   965  1005 I WM-WorkerWrapper: Worker result FAILURE for Work [ id=3af45b58-efee-4c88-b917-bafc9099c053, tags={ me.ash.reader.domain.service.SyncWorker, ReadYou } ]

…not sure what FeverRssService.kt:1493 is in a file with 348 lines :)

But after a quick look at the code and the responses, I think it's this:

groupId = accountId.spacerDollar(feedsGroupsMap[it.id.toString()]!!),

It !! assumes that every feed has been found in a group, while the feeds response from yarr has an empty feeds_groups array:

{
    "api_version": 3,
    "auth": 1,
    "feeds": [
        {
            "id": 2,
            "favicon_id": 2,
            "title": "Val Packett's Blog",
            "url": "https://val.packett.cool/feed.json",
            "site_url": "https://val.packett.cool/",
            "is_spark": 0,
            "last_updated_on_time": 1731348555
        },
        // …
    ],
    "feeds_groups": [],
    "last_refreshed_on_time": 1731348555
}

Reeder 5, Newsflash, and various other clients don't have any problem with this.

@valpackett valpackett added the bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant