fix(epic): a paused install keeps what it downloaded (#1504)

This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-10-24 14:47:18 -04:00
1 parent 8156a9649d
commit 4dda1c1e52
7 files changed
+319 -25

No files matched your search

+5 -1
View File
@@ -116,6 +116,10 @@ Numbers in brackets refer to the spec's list of unknowns.
several native threads.
19. **Network window** is the speed tier's value clamped to 1–128; the per-host cap is
`max(6, ceil(window / hosts))`.
20. **Pause keeps half-written files**: a stopped run keeps each unfinished stage file as a `.part`
file named after the file's path, hash and size, with a `.part.list` of the parts already
written. The next run writes only the other parts and hashes the whole file when it is complete;
that SHA-1 check still decides whether the file is kept, so files without one start over.
**Kept at parity (known weak spots)**
@@ -131,7 +135,7 @@ Numbers in brackets refer to the spec's list of unknowns.
- `AdditionalCommandLine` is one argument, frozen at install [11].
- Shop search, an unused "wants an exchange code" helper and per-game uninstall work are not
ported; DLC stay hidden and are never installed separately; optional (non-language) install tags
are never selected; resume restarts a partially written file from zero [15–18].
are never selected [15–18].
- Library details are fetched one game at a time, as before.
## What needs device testing
+9 -5
View File
@@ -85,18 +85,22 @@ installed record (`StoreInstalls.complete`). Resume, update and repair are the s
no cache (needs only the net peak); when even that does not fit the install is refused before any
chunk request, naming the storage, the need, the free space and the shortfall.
- **Progress**: the bar counts pending-file bytes written (not compressed chunk bytes), at most every
50 ms plus once per finished file. The run logs `epic: plan …` and `epic: summary mode=adaptive|narrow
50 ms plus once per finished file. A resumed run starts the bar at what earlier runs kept; on a
fresh install that includes the files already complete, so the bar carries on from the pause. The run logs `epic: plan …` and `epic: summary mode=adaptive|narrow
files=… bytes_written=… avg_mbps=… fetches=… refetches=… peak_cache_mib=… hosts=…`.
- **Cancel / pause / failure**: the cancel flag is forwarded within 250 ms; the run stops its
requests, joins its threads, removes every unfinished stage file and `.part` cache entry, and only
then returns. Swapped files stay; unswapped destinations keep their old content; the chunk cache
requests, joins its threads, removes every `.part` cache entry, and only then returns. On a cancel
or a download error each unfinished stage file is kept in the staging folder as
`<path id>-<sha1>-<size>.part`, with the written parts' offsets in `<same>.part.list`; the next run
fetches only the other parts and hashes the whole file once it is complete (a partial that no
longer matches the manifest, or whose file has no SHA-1 in it, is deleted). Any other failure removes the unfinished stage files. Swapped files stay; unswapped destinations keep their old content; the chunk cache
stays for the next run. Success removes the cache and the staging folder (when only its marker is
left).
The staging folder is recognised by its `owner` marker (`DroidDeck Epic staging v1` + LF). Before
the delta pass the run checks that the folder is a real directory at the expected canonical path,
that the marker matches and that every other entry is a plain `.stage` file directly inside it; only
then are those orphans deleted. Anything unexpected fails the run without deleting. A manifest path
that the marker matches and that every other entry is a plain `.stage`, `.part` or `.part.list` file
directly inside it; only then are the `.stage` orphans deleted. Anything unexpected fails the run without deleting. A manifest path
naming the staging folder, an absolute path or a `..` segment is refused. `.stage` / `.part` files
elsewhere in the game folder are never touched.