From 8772077ed16ef11f7c4a91b3e5d7c2b52a81f114 Mon Sep 17 00:00:00 2001 From: Joe Date: Sat, 7 Mar 2026 12:10:35 -0600 Subject: [PATCH] Move globIgnoredChildren guard before shouldDeleteUnknownInstances The guard was placed after the early return, so when ignoreUnknownInstances was false the function exited at line 39 before ever reaching the globIgnoredChildren check. Project nodes and meta files can override ignoreUnknownInstances independently, causing incorrect deletions of glob-ignored instances. --- plugin/src/Reconciler/diff.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugin/src/Reconciler/diff.lua b/plugin/src/Reconciler/diff.lua index bb3409f2..175407fc 100644 --- a/plugin/src/Reconciler/diff.lua +++ b/plugin/src/Reconciler/diff.lua @@ -35,17 +35,18 @@ local SCRIPT_CLASS_NAMES = { } local function shouldDeleteChild(virtualInstance, childInstance) - if shouldDeleteUnknownInstances(virtualInstance) then - return true - end - -- When the parent has glob-ignored children, suppress ALL deletions - -- (including scripts). This differs from scripts-only mode where - -- scripts are still eligible for deletion. + -- (including scripts) unconditionally. This must be checked before + -- shouldDeleteUnknownInstances because project nodes and meta files + -- can override ignoreUnknownInstances independently. if virtualInstance.Metadata and virtualInstance.Metadata.globIgnoredChildren then return false end + if shouldDeleteUnknownInstances(virtualInstance) then + return true + end + -- In scripts-only mode (where parent has ignoreUnknownInstances: true), -- we still want to allow deletion of scripts. This ensures deleted -- script files show up in the sync diff.