From 4a5beebdf8e4e3a7f3086c22caa32195a9815631 Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Wed, 13 May 2026 17:19:05 -0400 Subject: [PATCH] fix: TRAC-513 - clear stale variation override on stencil pull --- lib/stencil-pull.utils.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/stencil-pull.utils.js b/lib/stencil-pull.utils.js index b1d3f024..99dab829 100644 --- a/lib/stencil-pull.utils.js +++ b/lib/stencil-pull.utils.js @@ -74,15 +74,19 @@ utils.mergeThemeConfiguration = async (options) => { continue; } const defaultVal = localConfig.settings[key]; + // Compare against the variation override (when present) so stale ones get cleared. + const effectiveLocalVal = _.has(variation.settings, key) + ? variation.settings[key] + : defaultVal; // Check for different types, and throw an error if they are found - if (typeof defaultVal !== typeof remoteVal) { + if (typeof effectiveLocalVal !== typeof remoteVal) { throw new Error( `Theme configuration key "${key}" cannot be merged because it is not of the same type. ` + - `Remote configuration is of type ${typeof remoteVal} while local configuration is of type ${typeof defaultVal}.`, + `Remote configuration is of type ${typeof remoteVal} while local configuration is of type ${typeof effectiveLocalVal}.`, ); } // If a different value is found, overwrite the local config - if (!_.isEqual(defaultVal, remoteVal)) { + if (!_.isEqual(effectiveLocalVal, remoteVal)) { if (!variation.settings) { variation.settings = {}; }