Commit Graph
2 Commits
Author SHA1 Message Date
LibretroAdmin 267d4453b5 cloud sync: back up by copying when a rename cannot reach the backup
Backups go under the assets directory, wherever saves live. A rename
fails when those are on different volumes, or on Android when saves are
in a SAF folder, and the file then was not backed up: non-destructive
mode gave up on replacing it.

Fall back to copying the file and removing the original. If it cannot
be removed, drop the copy and report the failure, as the caller relies
on the local file being gone. cloudsync_commit_test covers both a
replaced and a removed file with such a rename refused.
2026-11-09 03:43:06 +01:00
Codex 7361e44c2d Cloud sync: serialize save mutations with content ownership
Run the budgeted sync handler on the content thread while blocking network calls retain their worker. This keeps ownership checks, backups, replacements and deletions ordered with savefile lifetime changes.

Keep a local save in place until its download is complete. If the completion cannot be handed to the handler, discard the temporary file and carry the manifests forward instead of committing on the callback thread.

Exercise threaded and unthreaded queues, both replacement modes, ownership acquired during transfer, backup contents and failed completion allocation.
2026-10-12 13:28:56 +02:00