Merge pull request #122 from narrrl/feat/protect-queued-changes

feat: protect queued changes at shutdown and sign-out (B66)
This commit is contained in:
nvrl authored and GitHub committed 2026-11-21 23:46:37 +01:00
commit 7be4c7db1e
18 files changed
+3644 -3252

No files matched your search

+15 -2
View File
@@ -74,7 +74,6 @@ original wording.
| [B134](#b134--a-file-deleted-online-while-the-drain-checks-its-write-is-kept-as-a-conflict-copy) | A file deleted online while the drain checks its write is kept as a conflict copy | Only with `local_first` off |
| [B91](#b91--the-daemon-hung-overnight-and-nothing-could-say-what-it-was-waiting-on) | The daemon hung overnight, and nothing could say what it was waiting on | The cause is not diagnosed; the daemon now reports where it is stuck and is restarted |
| [B67](#b67--fresh-state-restore-can-silently-select-a-new-device-high-22) | Fresh-state restore can silently select a new device (HIGH-22) | An ambiguous device after a loss of local state is not asked about |
| [B66](#b66--local-only-pending-data-is-not-protected-at-shutdown-high-21) | Local-only pending data is not protected at shutdown (HIGH-21) | No shutdown protection and no `pdfs sync flush` |
| [B65](#b65--release-artifacts-lack-supply-chain-verification-med-11) | Release artifacts lack supply-chain verification (MED-11) | No SBOM, provenance or checksums |
| [B15](#b15--an-empty-but-listed-folder-and-duplicated-folder-uids) | An empty-but-`listed` folder, and duplicated folder uids | Cause not attributed |
| [B10](#b10--glib-critical-when-the-launcher-closes-over-an-in-flight-open) | GLib critical when the launcher closes over an in-flight open | |
@@ -109,6 +108,7 @@ a live account since.
| Entry | Title |
|---|---|
| [B66](#b66--local-only-pending-data-is-not-protected-at-shutdown-high-21) | Local-only pending data is not protected at shutdown (HIGH-21) |
| [B291](#b291--on-fedora-45s-oo7-every-saved-sign-in-is-lost-at-the-next-reboot) | On Fedora 45's oo7, every saved sign-in is lost at the next reboot |
| [B289](#b289--the-takeout-import-mixes-in-other-services-and-drops-location-and-live-photos) | The Takeout import mixes in other services and drops location and live photos |
| [B288](#b288--an-interrupted-takeout-import-reads-as-finished-and-one-error-ends-it) | An interrupted Takeout import reads as finished, and one error ends it |
@@ -7475,7 +7475,7 @@ duplicates, renamed folders, multiple devices, and byte-identical restoration.
### B66 — Local-only pending data is not protected at shutdown (HIGH-21)
**Status:** Open — 1.0 data-safety/UX blocker
**Status:** Fixed, unverified live
**Found:** 2026-07-22, 1.0 recovery audit
**Where:** shutdown, CLI/GUI status, logout/unregister workflows
@@ -7488,6 +7488,19 @@ and last errors, and protect destructive lifecycle actions. Test offline stop,
logout, unregister, reboot, retry exhaustion, and drain. Credential removal must
never delete staged bytes.
**Fix:** `crates/pdfs-fuse/src/inhibit.rs` takes a logind shutdown inhibitor
(`systemd-inhibit --what=shutdown --mode=block`) while the queue holds changes
the drain can send, and lets it go once they land. Parked transient files and
changes that need the user are left out, so they never hold a power-off up for
good. `pdfs sync flush` retries failed changes and waits for the queue, with
its own exit codes for "needs you" and timeout. `pdfs logout` and the app's
Sign Out dialog say how many changes are still queued and that they stay
staged. Credential removal never touched `staging/`.
**Verified:** unit tests for which work holds the lock; `systemd-inhibit` in
block mode taken by a user process on 2026-11-21. A power-off with a queued
upload is still owed.
---
### B65 — Release artifacts lack supply-chain verification (MED-11)
+10
View File
@@ -11,6 +11,16 @@ scratch (user data in `staging/` and `recovery/` is never touched by this).
## [Unreleased]
### Added
- `pdfs sync flush` waits until every queued change is on Proton Drive, retrying
failed ones at once. It exits 3 when what is left needs you and 4 on `--timeout`.
- While changes are queued that only this computer has, the daemon holds off a
shutdown through logind, and desktops show "Sending N changes to Proton Drive" in
their power-off dialog. Changes waiting on you never hold it up (B66).
- Signing out, in the app or with `pdfs logout`, says how many changes are not on
Proton Drive yet. They stay on this computer and are sent after the next sign-in.
### Changed
- A Google Photos import uploads two photos at once instead of one, while the next
+2 -1
View File
@@ -70,7 +70,7 @@ The script runs `pdfs` from `PATH` on every Tab, so it keeps working after an up
| `pdfs login [-u EMAIL] [--remember]` | Sign in (password, then a 2FA code if the account has one) and store the session in the system keyring. Restarts the service if it is running. `--remember` keeps a two-password account unlocked across logins. |
| `pdfs unlock [--remember]` | Enter the mailbox password of a two-password account, so the service can open your files. Needed once per login session, or once with `--remember`. |
| `pdfs lock` | Forget the unlock held in memory; the account is locked again. |
| `pdfs logout` | End the session on Proton and remove the stored session. |
| `pdfs logout [--yes]` | End the session on Proton and remove the stored session. Asks first while changes are still queued; they stay on this computer and are sent after the next sign-in. |
| `pdfs status` | Account, mount, queue and cache state. |
| `pdfs quota` | Storage used across all Proton products. |
| `pdfs locations` | Every local place the service occupies: the Proton Drive folder and each synced folder, with mode and state. |
@@ -125,6 +125,7 @@ commands are for scripts and for cases where the mount is not available.
| `pdfs sync ignore check PATH` | Say whether a file in a synced folder is synced, and which pattern decides. |
| `pdfs sync limit [--up RATE] [--down RATE]` | Cap bandwidth, for example `500K` or `2M` per second. `0` removes a cap. Without options, prints the current caps. |
| `pdfs sync queue` | List changes that have not reached Proton Drive yet. |
| `pdfs sync flush [--timeout SECS]` | Retry failed changes now and wait until the queue is empty. Exits 0 when everything is on Proton Drive, 3 when what is left needs you (see `sync issues`), 4 on timeout. Says so while sync is paused or offline. |
| `pdfs sync issues` | List queued changes Proton Drive refused or that keep failing, and what to do. |
| `pdfs sync export ID DEST` | Save a copy of a queued upload's content. `DEST` may be a folder; an existing file is never overwritten. The upload stays queued. |
| `pdfs sync discard ID [--yes]` | Drop a queued change and undo it here: a new file or folder goes, anything else goes back to what Proton Drive has. Content not exported first is lost. |
+1 -1
View File
@@ -43,7 +43,7 @@ them along.
| Item | State | Notes |
|---|---|---|
| Protect queued changes at shutdown | Not started | A systemd inhibitor lock while `staging/` holds unsent data, a warning when signing out, and a `pdfs sync flush` that waits for the queue. Today the queue is visible in `pdfs sync queue`, the tray and **Sync → Overview**, but nothing stops a shutdown (B66) |
| Protect queued changes at shutdown | Done, live check owed | The daemon holds a logind shutdown inhibitor while the queue holds changes it can send, signing out warns with the count, and `pdfs sync flush` waits for the queue (B66) |
| Restore pins from the machine profile | Not started | `profile.json` records pins; `pdfs sync restore` does not apply them yet |
| Profile backup health | Not started | A failed profile upload is a `WARN` in the log and nothing in the app (B68) |
| Rotated credentials survive a keyring failure | Open | Report and retry keyring write failures, so a rotated single-use refresh token is not lost (B61) |