From 9f3d390f0e22d58e464a870f40b1934c5659bf4c Mon Sep 17 00:00:00 2001 From: Nate Pelzel Date: Mon, 31 Aug 2026 21:20:32 -0600 Subject: [PATCH] Fix delta updates deleting nested files on Windows (#486) GameDownloadAgent::run() prunes the install directory by comparing locally-scanned relative paths against the manifest's file_list keys. file_list is always written with `/` separators (see droplet's path_backend.rs), regardless of which OS produced the manifest, but Path::strip_prefix().to_string_lossy() on Windows yields `\`-separated strings. Every nested file therefore fails the exact-string HashMap lookup and gets deleted on every download/update, while flat root files (no separator to disagree on) happen to survive. This is most visible on Unity games, where nearly all content lives under a deeply nested *_Data folder. Confirmed against a live Drop server: 401/407 of a real game's file_list entries contain `/`, with the remaining 6 being separator-less root files, matching exactly which files survive vs. get pruned. --- desktop/src-tauri/games/src/downloads/download_agent.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/src-tauri/games/src/downloads/download_agent.rs b/desktop/src-tauri/games/src/downloads/download_agent.rs index 9718ca27..ad8598ec 100644 --- a/desktop/src-tauri/games/src/downloads/download_agent.rs +++ b/desktop/src-tauri/games/src/downloads/download_agent.rs @@ -308,7 +308,7 @@ impl GameDownloadAgent { let current_file_tree = self.scan_filetree(base_path)?; for file in current_file_tree { - let filename = file.strip_prefix(base_path)?.to_string_lossy().to_string(); + let filename = file.strip_prefix(base_path)?.to_string_lossy().replace('\\', "/"); let needed = file_list.contains_key(&filename) || filename == ".dropdata"; if !needed { debug!("deleted {}", file.display());