project-chip / matter.js

A complete typescript implementation of the Matter protocol specification (https://buildwithmatter.com). Includes full support for controller, device, commissioning, secure communications, device types, and cluster definitions.
Apache License 2.0
346 stars 59 forks source link

Freeze operational schema #1089

Closed lauckhart closed 2 months ago

lauckhart commented 2 months ago

When we use models operationally as schema we treat them as immutable. We now formalize this by freezing constituent objects. This results in an error (assuming strict mode) for operations that would otherwise change the schema.

Includes tests for ConcentrationMeasurement cluster and a related fix for feature map configuration for derived clusters.

semanticdiff-com[bot] commented 2 months ago

Review changes with SemanticDiff.

Analyzed 11 of 12 files.

Overall, the semantic diff is 6% smaller than the GitHub diff.

Filename Status
:grey_question: packages/matter.js/test/behavior/definitions/concentration-measurement/ConcentrationMeasurementServerTest.ts Unsupported file format
:heavy_check_mark: packages/matter.js/src/model/models/Children.ts Analyzed
:heavy_check_mark: packages/matter.js/src/model/models/ClusterModel.ts 18.11% smaller
:heavy_check_mark: packages/matter.js/src/model/models/Model.ts Analyzed
:heavy_check_mark: packages/matter.js/src/model/models/ValueModel.ts Analyzed
:heavy_check_mark: packages/matter.js/src/model/aspects/Aspect.ts 61.55% smaller
:heavy_check_mark: packages/matter.js/src/model/aspects/Conformance.ts Analyzed
:heavy_check_mark: packages/matter.js/src/model/aspects/Constraint.ts Analyzed
:heavy_check_mark: packages/matter.js/src/behavior/supervision/BehaviorSupervisor.ts Analyzed
:heavy_check_mark: packages/matter.js/src/behavior/definitions/switch/SwitchServer.ts Analyzed
:heavy_check_mark: packages/matter.js/src/behavior/definitions/general-diagnostics/GeneralDiagnosticsServer.ts Analyzed
:heavy_check_mark: packages/matter.js/src/behavior/cluster/ClusterBehaviorUtil.ts Analyzed