fix(update): verify and apply the actual latest version

This commit is contained in:
Sucukdeluxe
2026-08-21 07:39:37 +02:00
parent 4cebc6fefd
commit 6efdca6885
10 changed files with 154 additions and 41 deletions
+11 -2
View File
@@ -44,8 +44,17 @@ afterEach(() => {
vi.restoreAllMocks();
});
describe("update", () => {
it("normalizes update repo input", () => {
describe("update", () => {
it("always refreshes release metadata before installing instead of using the previous check result", () => {
const controller = fs.readFileSync(new URL("../src/main/app-controller.ts", import.meta.url), "utf8");
const install = controller.slice(controller.indexOf("public async installUpdate"), controller.indexOf("public addLinks"));
expect(install).toContain("installLatestUpdate(this.settings.updateRepo, undefined, onProgress)");
expect(install).not.toContain("cacheAgeMs");
expect(install).not.toContain("this.lastUpdateCheck &&");
});
it("normalizes update repo input", () => {
expect(normalizeUpdateRepo("")).toBe("Sucukdeluxe/Multi-Debrid-Downloader");
expect(normalizeUpdateRepo("owner/repo")).toBe("owner/repo");
expect(normalizeUpdateRepo("https://github.com/owner/repo")).toBe("owner/repo");