From e46ecd850ec49fb2d97d8e4cca71ab30dc1849e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Wed, 4 Nov 2026 00:25:01 +0000 Subject: [PATCH] fix(cli): check ignores the cancelled fetch of a proxy-swapped media file, not a broken image (#6928) * fix(cli): check ignores the cancelled fetch of a proxy-swapped video in any container * fix(cli): check ignores the cancelled fetch of a proxy-swapped media file, not a broken image --- packages/cli/src/commands/validate.test.ts | 15 ++++++++++ packages/cli/src/commands/validate.ts | 5 +++- packages/cli/src/utils/checkBrowser.test.ts | 31 +++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/validate.test.ts b/packages/cli/src/commands/validate.test.ts index bfe021fd1a..c013d35e43 100644 --- a/packages/cli/src/commands/validate.test.ts +++ b/packages/cli/src/commands/validate.test.ts @@ -181,6 +181,21 @@ describe("shouldIgnoreRequestFailure", () => { ).toBe(true); }); + it("ignores the aborted fetch of a proxy-swapped source for a listed media suffix", () => { + for (const ext of ["mkv", "m4v", "mts", "m2ts", "avi", "mpg", "MKV"]) { + const url = `http://127.0.0.1:3000/Caf%C3%A9%20%C3%A9t%C3%A9.${ext}`; + expect(shouldIgnoreRequestFailure(url, "net::ERR_ABORTED", "fetch")).toBe(true); + expect(shouldIgnoreRequestFailure(url, "net::ERR_FAILED", "fetch")).toBe(false); + } + }); + + it("keeps an aborted image request reportable whatever its file suffix", () => { + for (const ext of ["mkv", "mp4", "png"]) { + const url = `http://127.0.0.1:3000/assets/plate.${ext}`; + expect(shouldIgnoreRequestFailure(url, "net::ERR_ABORTED", "image")).toBe(false); + } + }); + it("keeps non-media and non-aborted failures reportable", () => { expect( shouldIgnoreRequestFailure("http://127.0.0.1:3000/assets/map.png", "net::ERR_ABORTED"), diff --git a/packages/cli/src/commands/validate.ts b/packages/cli/src/commands/validate.ts index 46e13768f4..21afa80b3b 100644 --- a/packages/cli/src/commands/validate.ts +++ b/packages/cli/src/commands/validate.ts @@ -51,7 +51,9 @@ interface ContrastEntry { const CONTRAST_SAMPLES = 5; const SEEK_SETTLE_MS = 150; const PREFERRED_SEEK_TARGET_WAIT_MS = 500; -const MEDIA_EXTENSIONS = /\.(aac|flac|m4a|mov|mp3|mp4|oga|ogg|wav|webm)$/i; +// Media files a proxy swap can abandon mid-fetch; an aborted non-image request for one is not a load failure. +const MEDIA_EXTENSIONS = + /\.(3gp|aac|aif|aiff|avi|flac|flv|m2ts|m4a|m4v|mkv|mov|mp3|mp4|mpeg|mpg|mts|mxf|oga|ogg|ogv|opus|wav|weba|webm|wma|wmv)$/i; // Turn Puppeteer's opaque "Navigation timeout of Nms exceeded" into an // actionable message: the usual cause is a slow blocking CDN