fix: compliance comparison uses String() to handle number vs string mismatch
This commit is contained in:
1 parent
8265fb7f0f
commit
ce4a857bb1
1 file changed
+6
-6
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user