From 2970a88c54f58553f126000786f9bd7ec310f8f1 Mon Sep 17 00:00:00 2001 From: "Ethan.Z" Date: Wed, 11 Feb 2026 11:45:22 -0500 Subject: [PATCH 1/3] do not disable toggling on desc features, display warning instead --- .../validation/conformance-checker.js | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src-electron/validation/conformance-checker.js b/src-electron/validation/conformance-checker.js index d2108233f4..2d7cfbba61 100644 --- a/src-electron/validation/conformance-checker.js +++ b/src-electron/validation/conformance-checker.js @@ -90,19 +90,7 @@ function generateWarningMessage( } } - // Check 2: if the feature conformance contains the operand 'desc' - let featureContainsDesc = conformEvaluator.checkIfExpressionHasOperand( - featureData.conformance, - dbEnum.conformanceTag.described - ) - if (featureContainsDesc) { - result.warningMessage.push( - warningPrefix + - ` ${updateDisabledString} its conformance is too complex for ZAP to process, or it includes 'desc'.` - ) - } - - // Check 3: if the feature update will change the conformance of other dependent features + // Check 2: if the feature update will change the conformance of other dependent features if (featuresToUpdate && Object.keys(featuresToUpdate).length > 0) { let featuresToUpdateString = Object.entries(featuresToUpdate) .map(([feature, isEnabled]) => @@ -115,7 +103,7 @@ function generateWarningMessage( ) } - // Check 4: if any elements that conform to the updated feature contain 'desc' in their conformance + // Check 3: if any elements that conform to the updated feature contain 'desc' in their conformance if ( (descElements.attributes && descElements.attributes.length > 0) || (descElements.commands && descElements.commands.length > 0) || @@ -142,7 +130,6 @@ function generateWarningMessage( if ( missingOperands.length == 0 && - !featureContainsDesc && (Object.keys(descElements).length == 0 || (descElements.attributes.length == 0 && descElements.commands.length == 0 && @@ -203,6 +190,17 @@ function generateWarningMessage( : buildNonElementConformMessage('enabled', 'mandatory')) result.displayWarning = !added } + // if the feature conformance contains the operand 'desc', do not disable toggling, but show warning message + let featureContainsDesc = conformEvaluator.checkIfExpressionHasOperand( + featureData.conformance, + dbEnum.conformanceTag.described + ) + if (featureContainsDesc) { + result.warningMessage = + warningPrefix + + ` is being ${added ? 'enabled' : 'disabled'}, but it has descriptive conformance and is too complex for ZAP to process.` + result.displayWarning = true + } // generate patterns for outdated feature warnings to be deleted let updatedFeatures = [featureData, ...(changedConformFeatures || [])] From a64bb65fefb0e150e99f33cdf2289ee878331522 Mon Sep 17 00:00:00 2001 From: "Ethan.Z" Date: Wed, 11 Feb 2026 12:49:40 -0500 Subject: [PATCH 2/3] improve warning message --- src-electron/validation/conformance-checker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-electron/validation/conformance-checker.js b/src-electron/validation/conformance-checker.js index 2d7cfbba61..d60f7b0ef9 100644 --- a/src-electron/validation/conformance-checker.js +++ b/src-electron/validation/conformance-checker.js @@ -198,7 +198,7 @@ function generateWarningMessage( if (featureContainsDesc) { result.warningMessage = warningPrefix + - ` is being ${added ? 'enabled' : 'disabled'}, but it has descriptive conformance and is too complex for ZAP to process.` + ` is being ${added ? 'enabled' : 'disabled'}, but it has descriptive conformance and requires manual validation from the feature specification to enable/disable the right dependencies in ZAP.` result.displayWarning = true } From 6029c86db59e02938110ec72a94db21b0dda3104 Mon Sep 17 00:00:00 2001 From: "Ethan.Z" Date: Wed, 11 Feb 2026 13:26:18 -0500 Subject: [PATCH 3/3] add unit test --- test/feature.test.js | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/feature.test.js b/test/feature.test.js index 179294c6b4..7cd946998e 100644 --- a/test/feature.test.js +++ b/test/feature.test.js @@ -767,6 +767,56 @@ test( testUtil.timeout.short() ) +test( + 'Check feature with desc conformance allows toggling but shows warning', + () => { + // Test enabling a feature with 'desc' conformance + let elements = { + attributes: [], + commands: [], + events: [] + } + let featureMap = { + DESCFEATURE: false + } + let featureWithDesc = { + cluster: 'Test Cluster', + name: 'Feature With Desc', + code: 'DESCFEATURE', + conformance: 'desc', + deviceTypes: ['Test Device Type'], + bit: 0 + } + let clusterFeatures = [featureWithDesc] + let endpointId = 1 + + // Enable the feature with 'desc' conformance + featureMap['DESCFEATURE'] = true + let result = conformChecker.checkElementConformance( + elements, + featureMap, + featureWithDesc, + endpointId, + clusterFeatures + ) + + // Should allow toggling (disableChange is false) but show warning + let warningPrefix = env.formatEmojiMessage( + '⚠️', + `Check Feature Compliance on endpoint: ${endpointId}, cluster: ${featureWithDesc.cluster}, ` + + `feature: ${featureWithDesc.name} (${featureWithDesc.code}) (bit ${featureWithDesc.bit} in featureMap attribute)` + ) + let expectedWarning = + warningPrefix + + ` is being enabled, but it has descriptive conformance and requires manual validation from the feature specification to enable/disable the right dependencies in ZAP.` + + expect(result.displayWarning).toBeTruthy() + expect(result.disableChange).toBeFalsy() + expect(result.warningMessage).toBe(expectedWarning) + }, + testUtil.timeout.short() +) + test( 'Test API for getting FeatureMap attribute value', async () => {