From 354478f204e5a33dd31f0ead9a4e9ab5af1a6d9b Mon Sep 17 00:00:00 2001 From: thesiti92 Date: Thu, 24 Sep 2026 00:44:31 -0400 Subject: [PATCH] Reduce the update zip listing before it crosses execFileSync's buffer assertZipFolder listed every entry of the update zip through execFileSync, and the packaged app's listing is over a megabyte, so the first preview run after #549 died with spawnSync unzip ENOBUFS. Cut the listing down to its distinct top-level names in the shell instead. Agent-Session: 78ffd160-974b-41b4-b7dd-d536de7c2833 Agent-Session: f1eb7ebd-a71b-44e2-8563-daff06cc220e Agent-Session: aad32659-bbbe-45b2-b163-317afc1a6a83 --- .../scripts/validate-release-artifacts.mjs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/review-desktop/scripts/validate-release-artifacts.mjs b/apps/review-desktop/scripts/validate-release-artifacts.mjs index c8bd8c82a..c073a3f3c 100644 --- a/apps/review-desktop/scripts/validate-release-artifacts.mjs +++ b/apps/review-desktop/scripts/validate-release-artifacts.mjs @@ -57,11 +57,17 @@ export function buildManifest({ version, commit, payloads, now = new Date() }) { // Squirrel installs the zip's top-level folder under that name, so a zip whose // folder does not match the bundle it is served to would rename the install. export function assertZipFolder(zip, folder) { - const entries = execFileSync("unzip", ["-Z1", zip], { encoding: "utf8" }) - .split("\n") - .filter(Boolean); - - const roots = new Set(entries.map((entry) => entry.split("/")[0])); + // The full listing runs past execFileSync's default buffer, so reduce it + // to the distinct top-level names before it crosses the pipe. + const roots = new Set( + execFileSync( + "sh", + ["-c", 'unzip -Z1 "$1" | cut -d/ -f1 | sort -u', "sh", zip], + { encoding: "utf8" }, + ) + .split("\n") + .filter(Boolean), + ); if (roots.size !== 1 || !roots.has(folder)) { throw new Error(