release: prepare v2.0.18 interface and reset reliability update

Preserve package progress and history across immediate cleanup, make extraction resets wait for all post-processing tasks, and keep archive diagnostics out of compact status cells. Rework account creation and settings selectors, improve context-menu placement, remove accidental row dragging, and expand regression coverage for the corrected workflows.
This commit is contained in:
Sucukdeluxe
2026-08-11 00:46:46 +02:00
parent 9b1eeada2e
commit ef5c20c8df
25 changed files with 1953 additions and 952 deletions
+32 -2
View File
@@ -6,7 +6,7 @@ import { parseDebridLinkApiKeys } from "../src/shared/debrid-link-keys";
import { getProviderUsageDayKey } from "../src/shared/provider-daily-limits";
import { AppSettings } from "../src/shared/types";
import { defaultSettings } from "../src/main/constants";
import { addHistoryEntryForRetention, createStoragePaths, emptySession, loadHistory, loadHistoryForRetention, loadSession, loadSettings, normalizeSettings, resetHistoryForRetention, saveHistory, saveSession, saveSessionAsync, saveSettings } from "../src/main/storage";
import { addHistoryEntryForRetention, createStoragePaths, emptySession, loadHistory, loadHistoryForRetention, loadSession, loadSettings, normalizeLoadedSession, normalizeSettings, resetHistoryForRetention, saveHistory, saveSession, saveSessionAsync, saveSettings } from "../src/main/storage";
const tempDirs: string[] = [];
@@ -672,7 +672,37 @@ describe("settings storage", () => {
expect(loaded.packages["pkg1"].name).toBe("Test Package");
});
it("returns empty session when session file contains invalid JSON", () => {
it("preserves cleaned package progress aggregates while normalizing a session", () => {
const session = emptySession();
session.packageOrder = ["pkg-progress"];
session.packages["pkg-progress"] = {
id: "pkg-progress",
name: "Progress",
outputDir: "C:\\Downloads\\Progress",
extractDir: "C:\\Downloads\\Progress\\Extracted",
status: "downloading",
itemIds: [],
cancelled: false,
enabled: true,
cleanedCompletedItemCount: 3,
cleanedExtractedItemCount: 2,
cleanedDownloadedBytes: 3_000,
cleanedTotalBytes: 4_000,
createdAt: Date.now(),
updatedAt: Date.now()
};
const normalized = normalizeLoadedSession(session);
expect(normalized.packages["pkg-progress"]).toEqual(expect.objectContaining({
cleanedCompletedItemCount: 3,
cleanedExtractedItemCount: 2,
cleanedDownloadedBytes: 3_000,
cleanedTotalBytes: 4_000
}));
});
it("returns empty session when session file contains invalid JSON", () => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rd-store-"));
tempDirs.push(dir);
const paths = createStoragePaths(dir);