From 140680215ba035a787583ecc45bec3007d76b06a Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:30:43 -0600 Subject: [PATCH] don't strip the fallback detect size when cloning --- web/e2e/specs/clone-camera.spec.ts | 48 ------------------------------ web/src/utils/cameraClone.ts | 7 +---- 2 files changed, 1 insertion(+), 54 deletions(-) diff --git a/web/e2e/specs/clone-camera.spec.ts b/web/e2e/specs/clone-camera.spec.ts index 2b213efb7f..1c75e71a3d 100644 --- a/web/e2e/specs/clone-camera.spec.ts +++ b/web/e2e/specs/clone-camera.spec.ts @@ -19,19 +19,8 @@ * and no PUT. That path is covered by unit-level review and manual QA. */ -import { readFileSync } from "node:fs"; -import { resolve, dirname } from "node:path"; -import { fileURLToPath } from "node:url"; import { test, expect } from "../fixtures/frigate-test"; -const __dirname = dirname(fileURLToPath(import.meta.url)); -const CONFIG_SCHEMA = JSON.parse( - readFileSync( - resolve(__dirname, "../fixtures/mock-data/config-schema.json"), - "utf-8", - ), -); - async function openCloneDialog(frigateApp: { page: import("@playwright/test").Page; }) { @@ -148,43 +137,6 @@ test.describe("Camera clone dialog @medium @mobile", () => { ).toBeVisible({ timeout: 8_000 }); }); - test("does not copy a fallback detect resolution to a new camera", async ({ - frigateApp, - }) => { - await frigateApp.installDefaults({ - config: { - cameras: { front_door: { detect_resolution_source: "default" } }, - }, - }); - // section payloads need the schema, which the default mock leaves empty - await frigateApp.page.route("**/api/config/schema.json", (route) => - route.fulfill({ json: CONFIG_SCHEMA }), - ); - const requests: unknown[] = []; - await frigateApp.page.route("**/api/config/set", async (route) => { - requests.push(route.request().postDataJSON()); - await route.fulfill({ json: { success: true, require_restart: false } }); - }); - - await frigateApp.goto("/settings?page=cameraManagement"); - await openCloneDialog(frigateApp); - await selectSource(frigateApp, "Front Door"); - await frigateApp.page - .getByPlaceholder(/e\.g\., back_door or Back Door/i) - .fill("clone_target_two"); - await frigateApp.page.getByRole("button", { name: /^Clone$/i }).click(); - - await expect.poll(() => requests.length, { timeout: 10_000 }).toBe(1); - const body = requests[0] as { - config_data: { - cameras: { clone_target_two: { detect?: Record } }; - }; - }; - const detect = body.config_data.cameras.clone_target_two.detect ?? {}; - expect(detect).not.toHaveProperty("width"); - expect(detect).not.toHaveProperty("height"); - }); - test("selects multiple existing destination cameras via a switch popover", async ({ frigateApp, }) => { diff --git a/web/src/utils/cameraClone.ts b/web/src/utils/cameraClone.ts index 58686e8289..f36fe4902b 100644 --- a/web/src/utils/cameraClone.ts +++ b/web/src/utils/cameraClone.ts @@ -672,14 +672,9 @@ export function buildClonedCameraPayloads({ formData: sourceSectionValue as ConfigSectionData, }, ); - // a fallback detect size would become an explicit value on the target - const fallbackDetect = - section === "detect" && sourceCfg.detect_resolution_source === "default" - ? ["width", "height"] - : []; let pendingSectionValue: unknown = sanitizeSectionData( cloneDeep(sourceSectionValue) as ConfigSectionData, - [...resolvedHiddenFields, ...fallbackDetect], + resolvedHiddenFields, ); if (FILTER_SECTION_DEFS[section]) {