authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 22:12:12-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 22:12:12-07:00
logcabac780f5d9566ea26d340c9f126a46664b698b
tree4c894686a23a9ebb8c750e0b3ff3de09b6ee98d4
parent76f686d03456539f41ef295f0071fecb5df08921
signature Signed by PGP key B5690EEEBB952194

test(desktop): cover WSL hashes through runtime resolution (#10285)


2 files changed, 1 insertions(+), 9 deletions(-)

apps/desktop/src/backend/DesktopBackendConfiguration.test.ts-8
......@@ -218,14 +218,6 @@ const withPackagedWslHarness = <A, E, R>(
218218 }).pipe(Effect.scoped, Effect.provide(NodeServices.layer));
219219
220220describe("DesktopBackendConfiguration", () => {
221 it("accepts only normalized SHA-256 archive identities", () => {
222 assert.equal(
223 DesktopBackendConfiguration.parseWslRuntimeArchiveHash(` ${"A".repeat(64)}\n`),
224 "a".repeat(64),
225 );
226 assert.isNull(DesktopBackendConfiguration.parseWslRuntimeArchiveHash("abc123"));
227 });
228
229221 it.effect("resolvePrimary produces a stable scoped bootstrap token", () =>
230222 withHarness(
231223 Effect.gen(function* () {
apps/desktop/src/backend/DesktopBackendConfiguration.ts+1-1
......@@ -243,7 +243,7 @@ const WSL_RUNTIME_ARCHIVE_NAME = "wsl-runtime.tar.gz";
243243const WSL_RUNTIME_ARCHIVE_HASH_NAME = `${WSL_RUNTIME_ARCHIVE_NAME}.sha256`;
244244const SHA256_HEX_PATTERN = /^[0-9a-f]{64}$/i;
245245
246export const parseWslRuntimeArchiveHash = (value: string): string | null => {
246const parseWslRuntimeArchiveHash = (value: string): string | null => {
247247 const trimmed = value.trim();
248248 return SHA256_HEX_PATTERN.test(trimmed) ? trimmed.toLowerCase() : null;
249249};