fix: a failed cloud save recovery no longer ends the app (#846)

The cloud-recovery thread started at every app start had nothing to
catch an error, so one went to CrashHandler, which halts the process
with status 2. In unit tests the thread can outlive the test that
started it, fail on the torn-down preferences, and take the whole test
run down. The error is now logged and the thread ends.

Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>
This commit is contained in:
KirkandKirk authored and GitHub committed 2026-10-14 22:01:17 -04:00
1 parent 929e049761
commit 45a808c80d
2 files changed
+44 -1

No files matched your search

@@ -233,7 +233,10 @@ object StoresState {
val overlay = java.io.File(com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context), "root/.local/share/droiddeck/epic-overlay")
if (overlay.exists()) Thread({ overlay.deleteRecursively(); Log.i(TAG, "removed the old EOS overlay download") }, "epic-overlay-cleanup").start()
val app = context.applicationContext
Thread({ CloudSaves.uploadAllDirty(app, "recovery") }, "cloud-recovery").start()
Thread({
runCatching { CloudSaves.uploadAllDirty(app, "recovery") }
.onFailure { Log.w(TAG, "cloud save recovery failed", it) }
}, "cloud-recovery").start()
}
internal fun post(block: () -> Unit) = main.post(block)