sync robustness: per-file retry with backoff, file-granular progress, bounded config fetch timeout, honest error details (bad origin / storage unavailable), isAvailable no longer gated on navigator.onLine (isolated LAN reports offline while origin is reachable)

This commit is contained in:
Lumen Stage1 2026-10-06 10:12:04 -05:00
commit a0db9f7862
5 changed files with 156 additions and 14 deletions

View file

@ -236,4 +236,16 @@ describe("app sync coordinator", () => {
});
expect(result.status).toBe("not-configured");
});
it("returns an error outcome (never throws/hangs) for a plain-HTTP origin", async () => {
const origin = buildOrigin();
const httpConfig = { ...config(origin), origin: "http://10.144.0.221:8080/origin" };
const result = await runSync({
fetchConfig: async () => httpConfig,
fetchImpl: fakeFetch(origin),
appVersion: "1.0.0",
});
expect(result.status).toBe("error");
expect(result.status === "error" && result.detail).toContain("HTTPS");
});
});