fix(extraction): make manual archive workflows deterministic

Scope selected item runs and stop mutations precisely, attach hybrid work to the active run, retain password progress, and report finalization with real percentages.

Drain stale post-processing before manual extraction, allow package and child extraction with open siblings, retry nonterminal hybrid archive attempts, and replace misleading aggregate retry counts with actionable conversion status.
This commit is contained in:
Sucukdeluxe
2026-08-23 01:21:45 +02:00
parent bffefe0130
commit b8a7c24954
12 changed files with 682 additions and 225 deletions
+47
View File
@@ -0,0 +1,47 @@
import { describe, expect, it } from "vitest";
import * as downloadManagerModule from "../src/main/download-manager";
describe("extraction progress labels", () => {
it("keeps a finalizing archive at its real 99 percent instead of counting it as complete", () => {
const format = (downloadManagerModule as Record<string, unknown>).formatExtractionProgressLabels as ((progress: Record<string, unknown>) => {
itemLabel: string;
packageLabel: string;
}) | undefined;
expect(format).toBeTypeOf("function");
if (!format) return;
expect(format({
current: 0,
total: 1,
percent: 99,
archiveName: "release.part01.rar",
archivePercent: 99,
elapsedMs: 17_000
})).toEqual({
itemLabel: "Finalisieren - 99% · release.part01.rar · 17s",
packageLabel: "Finalisieren - 99% (0/1) · release.part01.rar · 17s"
});
});
it("keeps password attempts more important than a stale 99 percent archive value", () => {
const format = (downloadManagerModule as Record<string, unknown>).formatExtractionProgressLabels as ((progress: Record<string, unknown>) => {
itemLabel: string;
packageLabel: string;
}) | undefined;
expect(format).toBeTypeOf("function");
if (!format) return;
expect(format({
current: 0,
total: 1,
percent: 99,
archiveName: "release.part01.rar",
archivePercent: 99,
passwordAttempt: 7,
passwordTotal: 7
})).toEqual({
itemLabel: "Passwort knacken: 100% (7/7) · release.part01.rar",
packageLabel: "Passwort knacken: 100% (7/7)"
});
});
});