mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-03 16:41:26 +01:00
fix(fuse,core): fix B114 to B120 from the account runs
- B114: `pdfs rm`, `pdfs rename` and `pdfs move` tell each kernel session that the old name is gone, so it stops resolving at once instead of for up to 30 seconds (`Core::forget_everywhere`, `Core::relocate_everywhere`). - B115: `pdfs ls` and the app's file browser wait up to 10 seconds for the listing's size fetch, as `stat` does, so they show a file's real size instead of its encrypted one. - B116: trashing a folder also drops the creates queued in its subfolders. A parked one stayed queued with its bytes, and a due one would have landed in the root. - B117: `pdfs move` and `pdfs rename` move the node in each mount instead of forgetting it, so its queued upload keeps its path in `pdfs sync queue` and is not put off once after the resume. - B118: when a create or mkdir reads back nothing, the mount asks again and then queues it as it does offline, instead of failing with ENOENT for something Drive has made. - B119: a landed upload keeps its staged bytes as the file's cached content, unless it is larger than a sixteenth of the cache, so reading a file just written does not need the network. - B120: a landed folder's row passes to its real uid in the same transaction, so a file queued inside it is not put off for five seconds. docs/BUGS.md records B117 to B120. The account run of 2026-10-03 verified B114 to B117 and B119 in My files.
This commit is contained in:
1 parent
625776081b
commit
37c04f1e69
9 files changed
+791
-105
No files matched your search
@@ -599,6 +599,50 @@ struct PriorRow {
|
||||
trashed: bool,
|
||||
}
|
||||
|
||||
/// Hand a drained placeholder's row, and the rows below it, to the real uid it
|
||||
/// landed as.
|
||||
///
|
||||
/// Dropping the placeholder row and waiting for the server's copy of the real
|
||||
/// node left a window with no row for either uid. A queued child drained in
|
||||
/// that window found no authority for its parent, re-read it over the network
|
||||
/// and was deferred five seconds behind a folder that had just landed
|
||||
/// (`docs/BUGS.md` B120). The placeholder's own node, readdressed, stands in
|
||||
/// until the server's copy is upserted over it. A row the real uid already
|
||||
/// has is newer than the placeholder and is kept.
|
||||
pub(super) fn adopt_placeholder_row_tx(
|
||||
tx: &Transaction<'_>,
|
||||
local: &str,
|
||||
real: &str,
|
||||
) -> Result<()> {
|
||||
tx.execute(
|
||||
"UPDATE nodes SET parent_uid = ?2 WHERE parent_uid = ?1",
|
||||
params![local, real],
|
||||
)?;
|
||||
let row: Option<(i64, Option<String>)> = tx
|
||||
.query_row(
|
||||
"SELECT rowid, node_json FROM nodes WHERE uid = ?1",
|
||||
params![local],
|
||||
|row| Ok((row.get(0)?, row.get(1)?)),
|
||||
)
|
||||
.optional()?;
|
||||
let Some((rowid, json)) = row else {
|
||||
return Ok(());
|
||||
};
|
||||
tx.execute("DELETE FROM nodes WHERE uid = ?1", params![local])?;
|
||||
tx.execute("DELETE FROM nodes_fts WHERE rowid = ?1", params![rowid])?;
|
||||
let known: bool = tx.query_row(
|
||||
"SELECT EXISTS(SELECT 1 FROM nodes WHERE uid = ?1)",
|
||||
params![real],
|
||||
|row| row.get(0),
|
||||
)?;
|
||||
let (false, Some(json), Some(real)) = (known, json, parse_node_uid(real)) else {
|
||||
return Ok(());
|
||||
};
|
||||
let mut node: Node = serde_json::from_str(&json)?;
|
||||
node.uid = real;
|
||||
upsert_node_tx(tx, &node)
|
||||
}
|
||||
|
||||
fn upsert_node_tx(tx: &Transaction<'_>, node: &Node) -> Result<()> {
|
||||
let json = serde_json::to_string(node)?;
|
||||
let uid = node.uid.to_string();
|
||||
|
||||
Reference in new issue
Block a user