feat(core,fuse,cli,gui): report changes Drive refuses as sync issues

A change Drive refuses because the storage is full, access was taken away,
its folder is gone, a folder limit is reached or the change was rejected
used to look like any other failure until six attempts had passed. The
drain now sorts the refusal into an issue and stores it on the queued op
(schema 38), so it needs attention at once in the app, tray and CLI. The
change stays queued and is retried; nothing is deleted.

The queue listing carries the issue and whether the op has file content.
ExportPendingOp copies that content to a new file: the Sync page offers it
as an Export button next to each issue, and the CLI as
`pdfs sync export <id> <dest>`. `pdfs sync issues` lists what needs
attention, and `pdfs sync queue` shows the issue per change.

docs/MILESTONE-3.0.0-STATUS.md tracks what is left for 3.0.0.
This commit is contained in:
nvrl committed 2026-10-04 03:18:57 +02:00
1 parent 77d0f254fc
commit a6f36d56f3
21 files changed
+2251 -1092

No files matched your search

+27
View File
@@ -6138,6 +6138,33 @@ fn retry_now_makes_a_backed_off_op_due_but_leaves_parked_ops_parked() {
assert_eq!(due(parked), ops::PARK_UNTIL);
}
/// A change Drive refused needs the user now, not after six more failures, and
/// its refusal is the error the status leads with.
#[test]
fn an_op_with_an_issue_counts_as_failing_at_once() {
let db = Db::open_in_memory().unwrap();
queued_op(&db, "vol~a", 1, 90_000);
let refused = queued_op(&db, "vol~b", 1, 90_000);
assert_eq!(db.pending_op_counts().unwrap().failing, 0);
db.record_op_failure(refused, "storage quota exceeded", 90_000)
.unwrap();
db.set_op_issue(refused, Some("quota")).unwrap();
let counts = db.pending_op_counts().unwrap();
assert_eq!(counts.failing, 1);
assert_eq!(counts.last_error.as_deref(), Some("storage quota exceeded"));
assert_eq!(
db.op_issues().unwrap(),
std::collections::HashMap::from([(refused, "quota".to_string())])
);
// The op stays queued with its bytes; clearing the issue is all it takes.
db.set_op_issue(refused, None).unwrap();
assert_eq!(db.pending_op_counts().unwrap().failing, 0);
assert!(db.op_issues().unwrap().is_empty());
assert_eq!(db.pending_ops().unwrap().len(), 2);
}
#[test]
fn retry_all_touches_only_ops_that_have_failed() {
let db = Db::open_in_memory().unwrap();