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:
nvrl committed 2026-10-26 17:45:22 +01:00
1 parent ea10a43216
commit a5acae41b3
23 files changed
+832 -238

No files matched your search

+56 -26
View File
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: proton-drive-linux 2.1.0\n"
"Report-Msgid-Bugs-To: https://github.com/narrrl/proton-drive-linux/issues\n"
"POT-Creation-Date: 2026-10-25 22:10+0100\n"
"POT-Creation-Date: 2026-10-26 17:16+0100\n"
"PO-Revision-Date: 2026-09-23 12:00+0200\n"
"Last-Translator: Proton Drive for Linux contributors\n"
"Language-Team: Polish\n"
@@ -66,7 +66,7 @@ msgstr "%A, %-d %B %Y, %H:%M"
#: crates/pdfs-gui/src/app/pages/browser.rs:1249
#: crates/pdfs-gui/src/app/pages/browser.rs:2167
#: crates/pdfs-gui/src/app/pages/browser.rs:2246
#: crates/pdfs-gui/src/app/pages/locations.rs:1667
#: crates/pdfs-gui/src/app/pages/locations.rs:1717
#: crates/pdfs-gui/src/app/pages/shared_by_me.rs:252
#: crates/pdfs-gui/src/app/pages/trash.rs:191 crates/pdfs-gui/src/prompt.rs:171
msgid "My files"
@@ -259,8 +259,9 @@ msgstr ""
#: crates/pdfs-gui/src/app/pages/devices.rs:1186
#: crates/pdfs-gui/src/app/pages/locations.rs:850
#: crates/pdfs-gui/src/app/pages/locations.rs:1054
#: crates/pdfs-gui/src/app/pages/locations.rs:1531
#: crates/pdfs-gui/src/app/pages/locations.rs:1537
#: crates/pdfs-gui/src/app/pages/locations.rs:1581
#: crates/pdfs-gui/src/app/pages/locations.rs:1631
#: crates/pdfs-gui/src/app/pages/login.rs:480
#: crates/pdfs-gui/src/app/pages/login.rs:594
#: crates/pdfs-gui/src/app/pages/login.rs:640
@@ -1311,8 +1312,9 @@ msgstr "Nie można wczytać albumów"
#: crates/pdfs-gui/src/app/pages/locations.rs:881
#: crates/pdfs-gui/src/app/pages/locations.rs:904
#: crates/pdfs-gui/src/app/pages/locations.rs:1123
#: crates/pdfs-gui/src/app/pages/locations.rs:1623
#: crates/pdfs-gui/src/app/pages/locations.rs:1643
#: crates/pdfs-gui/src/app/pages/locations.rs:1566
#: crates/pdfs-gui/src/app/pages/locations.rs:1673
#: crates/pdfs-gui/src/app/pages/locations.rs:1693
#: crates/pdfs-gui/src/app/pages/photo_viewer.rs:1504
#: crates/pdfs-gui/src/app/pages/photos.rs:1421
#: crates/pdfs-gui/src/app/pages/photos.rs:2141
@@ -2373,7 +2375,8 @@ msgid "Add Folder to Sync"
msgstr "Dodaj katalog do synchronizacji"
#: crates/pdfs-gui/src/app/pages/devices.rs:691
#: crates/pdfs-gui/src/app/pages/locations.rs:1636
#: crates/pdfs-gui/src/app/pages/locations.rs:1559
#: crates/pdfs-gui/src/app/pages/locations.rs:1686
msgid "Syncing folder…"
msgstr "Synchronizowanie katalogu…"
@@ -3297,16 +3300,41 @@ msgstr "Wznów synchronizację"
msgid "Pause Syncing"
msgstr "Wstrzymaj synchronizację"
#: crates/pdfs-gui/src/app/pages/locations.rs:1518
#: crates/pdfs-gui/src/app/pages/locations.rs:1513
msgid "Sync From Scratch…"
msgstr "Synchronizuj od nowa…"
#: crates/pdfs-gui/src/app/pages/locations.rs:1523
msgid "Stop Syncing…"
msgstr "Zatrzymaj synchronizację…"
#: crates/pdfs-gui/src/app/pages/locations.rs:1527
#: crates/pdfs-gui/src/app/pages/locations.rs:1533
msgid "Sync From Scratch?"
msgstr "Synchronizować od nowa?"
#. Translators: {path} is a local folder path.
#: crates/pdfs-gui/src/app/pages/locations.rs:1535
#, rust-format
msgid ""
"This computer forgets what it synced in {path} before and compares the "
"folder with Proton Drive again. Nothing is deleted: a file on one side only "
"is copied to the other, and a file that differs keeps both versions."
msgstr "Ten komputer zapomina, co wcześniej zsynchronizował w {path}, i ponownie porównuje katalog z Proton Drive. Nic nie zostanie usunięte: plik, który jest tylko po jednej stronie, zostanie skopiowany na drugą, a z pliku, który się różni, zostaną zachowane obie wersje."
#: crates/pdfs-gui/src/app/pages/locations.rs:1538
msgid "Sync From Scratch"
msgstr "Synchronizuj od nowa"
#: crates/pdfs-gui/src/app/pages/locations.rs:1557
msgid "Couldn't sync the folder from scratch"
msgstr "Nie można zsynchronizować katalogu od nowa"
#: crates/pdfs-gui/src/app/pages/locations.rs:1577
msgid "Make Folder Online Only?"
msgstr "Oznaczyć katalog jako tylko online?"
#. Translators: {path} is a local folder path.
#: crates/pdfs-gui/src/app/pages/locations.rs:1529
#: crates/pdfs-gui/src/app/pages/locations.rs:1579
#, rust-format
msgid ""
"Files in {path} will be removed from this computer and kept in Proton Drive "
@@ -3315,11 +3343,11 @@ msgstr ""
"Pliki w {path} zostaną usunięte z tego komputera i będą przechowywane tylko "
"w Proton Drive. Każdy plik zostanie ponownie pobrany przy otwarciu."
#: crates/pdfs-gui/src/app/pages/locations.rs:1532
#: crates/pdfs-gui/src/app/pages/locations.rs:1582
msgid "Make Online Only"
msgstr "Oznacz jako tylko online"
#: crates/pdfs-gui/src/app/pages/locations.rs:1568
#: crates/pdfs-gui/src/app/pages/locations.rs:1618
#, rust-format
msgid ""
"Every file in {path} will download to this computer and stay synced. {free} "
@@ -3328,62 +3356,62 @@ msgstr ""
"Każdy plik w {path} zostanie pobrany na ten komputer i pozostanie "
"synchronizowany. Wolne miejsce na tym dysku: {free}."
#: crates/pdfs-gui/src/app/pages/locations.rs:1573
#: crates/pdfs-gui/src/app/pages/locations.rs:1623
#, rust-format
msgid "Every file in {path} will download to this computer and stay synced."
msgstr ""
"Każdy plik w {path} zostanie pobrany na ten komputer i pozostanie "
"synchronizowany."
#: crates/pdfs-gui/src/app/pages/locations.rs:1578
#: crates/pdfs-gui/src/app/pages/locations.rs:1628
msgid "Download Folder?"
msgstr "Pobrać katalog?"
#: crates/pdfs-gui/src/app/pages/locations.rs:1582
#: crates/pdfs-gui/src/app/pages/locations.rs:1632
#: crates/pdfs-gui/src/app/update.rs:34
msgid "Download"
msgstr "Pobierz"
#: crates/pdfs-gui/src/app/pages/locations.rs:1606
#: crates/pdfs-gui/src/app/pages/locations.rs:1656
msgid "Couldn't pause the folder"
msgstr "Nie można wstrzymać katalogu"
#: crates/pdfs-gui/src/app/pages/locations.rs:1607
#: crates/pdfs-gui/src/app/pages/locations.rs:1657
msgid "Couldn't resume the folder"
msgstr "Nie można wznowić katalogu"
#: crates/pdfs-gui/src/app/pages/locations.rs:1613
#: crates/pdfs-gui/src/app/pages/locations.rs:1663
msgid "Folder paused"
msgstr "Wstrzymano katalog"
#: crates/pdfs-gui/src/app/pages/locations.rs:1614
#: crates/pdfs-gui/src/app/pages/locations.rs:1664
msgid "Folder resumed"
msgstr "Wznowiono katalog"
#: crates/pdfs-gui/src/app/pages/locations.rs:1638
#: crates/pdfs-gui/src/app/pages/locations.rs:1642
#: crates/pdfs-gui/src/app/pages/locations.rs:1688
#: crates/pdfs-gui/src/app/pages/locations.rs:1692
msgid "Couldn't sync"
msgstr "Nie można zsynchronizować"
#: crates/pdfs-gui/src/app/pages/locations.rs:1668
#: crates/pdfs-gui/src/app/pages/locations.rs:1718
msgid "Shared folder"
msgstr "Udostępniony katalog"
#: crates/pdfs-gui/src/app/pages/locations.rs:1670
#: crates/pdfs-gui/src/app/pages/locations.rs:1720
msgid "Going online only"
msgstr "Przechodzenie w tryb tylko online"
#: crates/pdfs-gui/src/app/pages/locations.rs:1671
#: crates/pdfs-gui/src/app/pages/locations.rs:1721
msgid "Switching to synced"
msgstr "Przełączanie na synchronizację"
#: crates/pdfs-gui/src/app/pages/locations.rs:1681
#: crates/pdfs-gui/src/app/pages/locations.rs:1731
msgctxt "state"
msgid "paused"
msgstr "wstrzymany"
#. Translators: a folder's files can't be opened right now.
#: crates/pdfs-gui/src/app/pages/locations.rs:1692
#: crates/pdfs-gui/src/app/pages/locations.rs:1742
msgid "not available"
msgstr "niedostępne"
@@ -6003,7 +6031,9 @@ msgstr "Ustawienia odnośnika"
#: crates/pdfs-gui/src/app/widgets/share_dialog.rs:802
msgid ""
"Change who can edit, the password or the expiry. The link stays the same."
msgstr "Proszę zmienić, kto może edytować, hasło lub datę wygaśnięcia. Odnośnik pozostaje ten sam."
msgstr ""
"Proszę zmienić, kto może edytować, hasło lub datę wygaśnięcia. Odnośnik "
"pozostaje ten sam."
#: crates/pdfs-gui/src/app/widgets/share_dialog.rs:849
msgid "New password"