Commit 4e775af
committed
fix(Patch): recover from interrupted patch instead of failing as corrupted
After a cancelled patch attempt, some files in installPath may already
be at the target version while the krpdiff expects old-version sources.
This causes ApplyDirPatch to crash or produce incorrect output.
Three layers of defense:
1. Delete pre-flight state file before Step 8 - forces fresh pre-flight
on retry so already-updated files are correctly detected.
2. Source file size pre-check - extends the existing missing-file check
to also verify source file sizes match the krpdiff expectation.
Wrong-size files (from previous partial move) skip the doomed patch
and go straight to CDN download. No more waiting for SharpHDiffPatch
to read multi-GB files and crash.
3. CDN fallback on patch failure - when ApplyDirPatch crashes (integer
overflow, array bounds, etc.) or post-patch MD5 mismatches, each
destination file is checked: if already at target, skip; otherwise
download from CDN. Replaces the hard throw that reported corruption.
4. Clean up leftover temp dirs before re-patching to avoid stale output
from a previous interrupted verify+move loop.1 parent 79d422a commit 4e775af
1 file changed
Lines changed: 263 additions & 30 deletions
0 commit comments