Tobi823 / ffupdater

FFUpdater: Updater for privacy friendly browser
https://f-droid.org/en/packages/de.marmaro.krt.ffupdater
GNU General Public License v3.0
702 stars 34 forks source link

background update check failed, stack trace shown #637

Open myuseraccount opened 1 month ago

myuseraccount commented 1 month ago

Important first questions

  1. FFUpdater up-to-date: 79.2.5, F-Droid build

  2. similar issues: 582 and 626, both closed

Describe the bug I get notifications titled "background update failed" with a stack trace

To Reproduce Not predictable. But I don't allow battery optimization exemption (unrestricted background) for ffupdater, and I leave data saver on. Update checks on metered networks is on, but not downloads.

Expected behavior Ffupdater should tolerate data being turned off or restricted through intentional means in the OS.

Error message from FFUpdater Stacktrace:

de.marmaro.krt.ffupdater.background.exception.AppUpdaterRetryableException: Simple network test was not successful. Retry later.
    at de.marmaro.krt.ffupdater.background.AppUpdater.isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:135)
    at de.marmaro.krt.ffupdater.background.AppUpdater.access$isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:44)
    at de.marmaro.krt.ffupdater.background.AppUpdater$isUpdateCheckPossible$1.invokeSuspend(AppUpdater.kt:0)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Logs:

de.marmaro.krt.ffupdater.background.exception.AppUpdaterRetryableException: Simple network test was not successful. Retry later.
    at de.marmaro.krt.ffupdater.background.AppUpdater.isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:135)
    at de.marmaro.krt.ffupdater.background.AppUpdater.access$isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:44)
    at de.marmaro.krt.ffupdater.background.AppUpdater$isUpdateCheckPossible$1.invokeSuspend(AppUpdater.kt:0)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Device information: Key Value
FFUpdater version 79.2.5 (175) release F-Droid/other
Device Pixel 5 (redfin, redfin, redfin)
Manufacturer google (Google)
Supported ABIs arm64-v8a, armeabi-v7a, armeabi
Android version 14 (SDK: 34)
OS tuotanto.eu.calyxos.net, cdesai, release-keys, 1728652786000
bearhoney commented 1 month ago

I see same crash reports. Device: OnePlus 8T, LineageOS with older Kernel (based on Android 11)

Tobi823 commented 1 month ago

@myuseraccount Thanks for the detailed error report.

I think this is a logic error on my side.

The "background update check" notification is only shown, if the "Simple network test was not successful" failed for 5 times in a row. (with 30s waiting time between the first and second try, 60s between 2nd and 3rd, 120s ...)

("Simple network test was not successful" = a HTTP head request to e.g. https://api.github.com failed)

I guess it is quite normal to have no internet/network for 30min. Maybe you also uses the airplane mode?

Tobi823 commented 1 month ago

@Tobi823 Solution: skip AppUpdater.kt when simple network test failed, because a failed HTTP head request is a good indicator for no internet

myuseraccount commented 1 week ago

Just got a slightly different crash.

Stacktrace:

de.marmaro.krt.ffupdater.background.exception.AppUpdaterRetryableException: Simple network test was not successful. Retry later.
    at de.marmaro.krt.ffupdater.background.AppUpdater.isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:135)
    at de.marmaro.krt.ffupdater.background.AppUpdater.access$isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:44)
    at de.marmaro.krt.ffupdater.background.AppUpdater$isUpdateCheckPossible$1.invokeSuspend(AppUpdater.kt:0)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Logs:

de.marmaro.krt.ffupdater.background.exception.AppUpdaterRetryableException: Simple network test was not successful. Retry later.
    at de.marmaro.krt.ffupdater.background.AppUpdater.isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:135)
    at de.marmaro.krt.ffupdater.background.AppUpdater.access$isUpdateCheckPossible-gIAlu-s(AppUpdater.kt:44)
    at de.marmaro.krt.ffupdater.background.AppUpdater$isUpdateCheckPossible$1.invokeSuspend(AppUpdater.kt:0)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Device information: Key Value
FFUpdater version 79.2.5 (175) release F-Droid/other
Device Pixel 5 (redfin, redfin, redfin)
Manufacturer google (Google)
Supported ABIs arm64-v8a, armeabi-v7a, armeabi
Android version 14 (SDK: 34)
OS tuotanto.eu.calyxos.net, cdesai, release-keys, 1728652786000 `