NeoApplications / Neo-Backup

backup manager for android
GNU Affero General Public License v3.0
2.37k stars 121 forks source link

[Bug] Crash when Restoring and interacting with app list #724

Open Gh3ttoKinG opened 1 year ago

Gh3ttoKinG commented 1 year ago

Description A clear and concise description of what the bug is. App often crashes and restarts when going back and interacting with the app while it's restoring a backup.

Steps To Reproduce

  1. Restore a backup (in my case a locked Telegram backup)
  2. Go back to the app list
  3. Select any app in the list
  4. Crashes and fails to restore. Notification still says "Restoring..."

Expected behavior Should open the selected backup menu for the app

Crash Logs

`type: crash
osVersion: google/raven/raven:13/TQ1A.230105.002/2023011000:user/release-keys
package: com.machiav3lli.backup:8208
process: com.machiav3lli.backup
processUptime: 31793 + 188 ms

java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
 at java.util.ArrayList.get(ArrayList.java:437)
 at k0.z1.q(Unknown Source:35)
 at k0.f2.m(Unknown Source:224)
 at m9.a.s(Unknown Source:8)
 at kc.i0.run(Unknown Source:100)
 at androidx.compose.ui.platform.e0.q0(Unknown Source:22)
 at androidx.compose.ui.platform.e0$c.run(Unknown Source:2)
 at android.os.Handler.handleCallback(Handler.java:942)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loopOnce(Looper.java:201)
 at android.os.Looper.loop(Looper.java:288)
 at android.app.ActivityThread.main(ActivityThread.java:7878)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
 at com.android.internal.os.ExecInit.main(ExecInit.java:49)
 at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
 at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
 Suppressed: ib.v: [k0.o1@67346e1, androidx.compose.ui.platform.j1@1b3ec06, t1{Cancelling}@e2982c7, e0@a6f80f4]`

System Information(please complete the following information):


Additional Notes

Since any other interaction seems to be working (Open Settings, Backup, Restore, Scheduling menu) it must be something with the app list. Scrolling through the list still works during the restoring. Maybe lock interaction with the app list until the Backup has been restored.

hg42 commented 1 year ago

Select any app in the list

do you mean select (via long press), or do you mean open another AppSheet?

hg42 commented 1 year ago

please use the neo version for such error reports (or a pumpkin apk).

because these lines are the most interesting and they only contain nonsense-names in a release version.

at k0.z1.q(Unknown Source:35)
at k0.f2.m(Unknown Source:224)
at m9.a.s(Unknown Source:8)
at kc.i0.run(Unknown Source:100)
Gh3ttoKinG commented 1 year ago

I have to admit, I don't know what you mean. What do you mean with the neo version? I downloaded the apk file from this GitHub. Also I'm not sure what you mean with a pumpkin apk.

machiav3lli commented 1 year ago

You seem to not have Telegram or Matrix?. So here you go the neo-build. It has another package name as the original build so you can install it parallel, then try to re-produce the crash (this would provide us with a better crash log).

Gh3ttoKinG commented 1 year ago

Ah, thank you. Here is the crash report from the neo version.

type: crash
osVersion: google/raven/raven:13/TQ1A.230105.002/2023011000:user/release-keys
package: com.machiav3lli.backup.neo:8300
process: com.machiav3lli.backup.neo
processUptime: 16790 + 224 ms

java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
    at java.util.ArrayList.get(ArrayList.java:437)
    at androidx.compose.runtime.Recomposer.recordComposerModificationsLocked(Recomposer.kt:1401)
    at androidx.compose.runtime.Recomposer.access$recordComposerModificationsLocked(Recomposer.kt:125)
    at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2.invokeSuspend(Recomposer.kt:491)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
    at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
    at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7878)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
    Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@fe447f2, androidx.compose.ui.platform.MotionDurationScaleImpl@94a8e43, StandaloneCoroutine{Cancelling}@6e92cc0, AndroidUiDispatcher@96abdf9]
hg42 commented 1 year ago

unfortunately this log doesn't contain any of these lines from our code...it's all from internal mechanisms of the compose library.

Could you try again until the log includes lines containing com.machiav3lli ?

And please make clear, if it's about opening an app sheet or the context menu or selecting an entry in the list (via long press)?

Gh3ttoKinG commented 1 year ago

Sorry, I totally forgot the first question now. What I mean is opening another AppSheet. So I click on "Restore Backup", go back and then click another app in the list. I now noticed that it's not always crashing when you try to open another AppSheet, if it's just a small backup it waits for the Restore to be finished and then opens the other AppSheet. But clicking on two or three apps in the list is a certain way for me to consistently cause the crash / restart of the app. But sadly so far I couldn't get lines that contain com.machiav3lli. Most of the time the app just restarts without any message or crash report.

hg42 commented 1 year ago

hmm, I wonder why it restarts? Without catchUncaughtExceptions, it would just crash (I think). If it is enabled, it would write a log (you find it in preferences/tools/log) and then restart. Do you have it enabled?

ok, I think I understand... this:

Most of the time the app just restarts without any message or crash report.

looks like you are expecting an error message or some other active notification.

But NB is in an unknown very precarious situation (because it was very unexpected), and the only way to get out (in all possible cases) is writing a log and restarting. Maybe I can find a more visible way... though this would need a way to notify the receiving end of the special condition.

The main purpose when I wrote this, was to log the exception and let the show go on, which means continuing the queued jobs.

Gh3ttoKinG commented 1 year ago

No, I didn't have it enabled, but I enabled it now and forces a crash. I can post it of you want.

hg42 commented 1 year ago

yes, please

Gh3ttoKinG commented 1 year ago

I uploaded the log file in Telegram because it's too much for GitHub and PasteBin. Log is from restoring Aegis and then causing the crash/restart. I also noticed that it's not just when restoring but also when creating a backup.

Link to the message with the file: https://t.me/neo_backup/48034

Edit: Here is also a video of my actions: https://t.me/neo_backup/48046