fix(downloads): harden recovery, replacement, and cleanup

- make media credential recovery durable and explicit across lifecycle entry points
- protect exact output replacement with platform-aware ownership, fingerprints, locks, and crash-safe quarantine
- permanently remove unfinished assets while preserving safe completed and Torrent cleanup
- add frontend, native, and localization regressions
This commit is contained in:
NimBold
2026-08-23 03:24:55 +03:30
parent 686bba97a9
commit d49c7bd292
33 changed files with 3242 additions and 192 deletions
+10
View File
@@ -788,6 +788,16 @@ const persistableRequestHeaders = (headers: string | null | undefined): string |
return lines.length > 0 ? lines.join('\n') : undefined;
};
/**
* Preserve only stable, non-credential request context for an explicit
* credentialless retry. This uses the same allow-list and URL sanitization as
* persistence so a retry cannot accidentally reuse a signed Referer or an
* unknown token-bearing header.
*/
export const headersWithoutCredentialMaterial = (
headers: string | null | undefined
): string | undefined => persistableRequestHeaders(headers);
/**
* Returns a shallow copy of `item` with secret fields removed. Volatile
* progress fields (`fraction`, `speed`, `eta`) are also dropped as in the