mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-04 16:56:59 +01:00
fix(sync,gui,cli): get a synced folder unstuck when its local copy is gone (#46)
A mirror folder whose files were all gone from this computer stayed in error for good. The wipe guard rightly refuses to trash the whole folder on Drive, but nothing got the folder out of that state: a queued switch to on-demand waits for a pass that ends idle, and its push pass hit the same guard. Only removing the folder from sync cleared the baseline that made the empty folder read as "delete everything". - The push pass for a switch to on-demand forgets the baseline rows of a local copy that is gone in full instead of trashing them, so the switch goes ahead and the mount shows what Drive has. - New Request::ResetSyncFolder, `pdfs sync reset ID` and "Sync From Scratch…" in a synced folder's menu clear a mirror folder's baseline (and a queued switch to on-demand, whose push pass would upload a duplicate of every file). The next pass compares both sides as on the first sync: one-sided files are copied across, files that differ keep both versions, nothing is deleted. - The wipe guards' messages name the reset; restore logs why it skipped a folder. Two simulations cover it. The on-demand one failed in exactly the reported state (mirror, pending ondemand, error) before the fix. All 8 catalogs translated.
This commit is contained in:
1 parent
ea10a43216
commit
a5acae41b3
23 files changed
+832
-238
No files matched your search
@@ -480,6 +480,11 @@ pub enum Request {
|
||||
/// Pause or resume one mirror folder's reconcile, independent of the
|
||||
/// global pause. Persisted until resumed. Replies with [`Response::Ok`].
|
||||
SetSyncFolderPaused { id: i64, paused: bool },
|
||||
/// Forget what a mirror folder synced before, so its next pass compares
|
||||
/// both sides afresh: what is on one side only is copied to the other, and
|
||||
/// a file that differs keeps both versions. Nothing is deleted. Replies
|
||||
/// with [`Response::Ok`].
|
||||
ResetSyncFolder { id: i64 },
|
||||
/// Force a reconcile pass: one folder by id, or all when `id` is `None`.
|
||||
/// Replies with [`Response::Ok`].
|
||||
SyncNow { id: Option<i64> },
|
||||
@@ -3209,6 +3214,7 @@ mod tests {
|
||||
id: 3,
|
||||
paused: true,
|
||||
},
|
||||
Request::ResetSyncFolder { id: 3 },
|
||||
Request::SetBandwidthLimits {
|
||||
upload: 1_000_000,
|
||||
download: 0,
|
||||
|
||||
Reference in new issue
Block a user