From ce4a857bb1da7648f920b2e3e79eee475804de5b Mon Sep 17 00:00:00 2001 From: Kevin L'Hereec Date: Tue, 2 Jun 2026 18:29:10 +0200 Subject: [PATCH] fix: compliance comparison uses String() to handle number vs string mismatch --- app/services/configuration_engine.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/services/configuration_engine.ts b/app/services/configuration_engine.ts index 30583e2..3ce4ccf 100644 --- a/app/services/configuration_engine.ts +++ b/app/services/configuration_engine.ts @@ -60,7 +60,7 @@ export interface DryRunResult { /** * ConfigurationEngine evaluates device compliance against configurations. - * + * * Responsibilities: * - Find matching enabled configurations for a device * - Select the highest priority configuration @@ -78,7 +78,7 @@ export default class ConfigurationEngine { /** * Evaluate device compliance against all matching configurations. - * + * * Steps: * 1. Load all enabled configurations * 2. Filter by criteria (glob matching against DeviceId) @@ -154,7 +154,7 @@ export default class ConfigurationEngine { // Check if compliant (no diffs and no firmware needed) const isCompliant = - parameterDiffs.length === 0 && + parameterDiffs.length === 0 && firmwareMigrationPath.length === 0 return { @@ -313,7 +313,7 @@ export default class ConfigurationEngine { /** * Determine if policy "once" should allow application of the configuration. - * + * * - For policy "maintain": always apply * - For policy "once": apply if device doesn't have the provisioning code * (indicating content has changed or never applied) @@ -366,8 +366,8 @@ export default class ConfigurationEngine { // Get current value from device const currentValue = this.getDeviceParameterValue(device, desired.name) - // Compare values - if (currentValue !== desired.value) { + // Compare values (loose: both as strings to handle type mismatches) + if (String(currentValue) !== String(desired.value)) { diffs.push({ name: desired.name, currentValue,