Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display warnings for provisional Matter clusters #1510

Merged
merged 6 commits into from
Feb 5, 2025

Conversation

ethanzhouyc
Copy link
Collaborator

JIRA: ZAPP-1571

  • Display a warning icon and message for enabled provisional clusters in Matter, ensuring compatibility with existing cluster warnings.
  • Add warnings for enabled provisional clusters to the notification system using SQL triggers.

@ethanzhouyc ethanzhouyc requested a review from brdandu January 26, 2025 20:00
src/components/ZclDomainClusterView.vue Outdated Show resolved Hide resolved
src/components/ZclDomainClusterView.vue Outdated Show resolved Hide resolved
let lackingRequiredCluster = false
/* A cluster has a warning if:
1. It is required but disabled, OR
2. It is provisional and enabled */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get a warning when a provisional cluster is enabled? Could you give an example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, warnings appear only when a provisional cluster is enabled. Showing warnings for all provisional clusters by default would create unnecessary distractions for users.

For example, the Chime Cluster is marked as provisional in its XML (<cluster apiMaturity="provisional">). Warning icon with messages and notifications will be displayed if user enables the cluster

)
expect(cluster).not.toBeNull()

clusterId = cluster.id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is needed not as a test but for calculation. Do you think this should go into beforeAll ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think beforeAll() should be limited to db setup and package loading. While cluster insertion is for calculation, future ZAP changes might affect it. Placing it in a separate module with expect() assertions ensures failures are easily traceable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we ever run into an issue where the below test runs before this in an asynchronous way and clusterId is not populated. I remember we had this issue at one point. Forgot how we resolved that. You will not face that issue if you put this in beforeAll however.

@ethanzhouyc ethanzhouyc requested a review from brdandu February 4, 2025 00:58
@ethanzhouyc
Copy link
Collaborator Author

ethanzhouyc commented Feb 4, 2025

@brdandu Improvements in new commits:

  1. provisional cluster warnings are set in the notification pane and printed to the console on opening a ZAP file
  2. add unit tests for setting provisional cluster warnings on opening a ZAP file

I added <cluster apiMaturity="provisional"> to scene.xml for testing purpose. (The cluster is marked as provisional in CHIP repo). The added unit tests require adding a new .zap file with enabled provisional cluster.

)
expect(cluster).not.toBeNull()

clusterId = cluster.id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we ever run into an issue where the below test runs before this in an asynchronous way and clusterId is not populated. I remember we had this issue at one point. Forgot how we resolved that. You will not face that issue if you put this in beforeAll however.

@@ -35,7 +35,7 @@ limitations under the License.
</struct>

<domain name="CHIP"/>
<cluster>
<cluster apiMaturity="provisional">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a chip repo and alchemy repo issue for CSA to start adding this to our existing XML?

Copy link
Collaborator Author

@ethanzhouyc ethanzhouyc Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alchemy can generate apiMaturity="provisional" when regenerating the entire ZAP XML. However, since the ZAP XML is too outdated for an entire update and only 22 clusters are marked as provisional in the CHIP repo, a manual update is more practical. Would you like me to create a PR for this?

@ethanzhouyc
Copy link
Collaborator Author

@brdandu According to my research, Jest runs tests sequentially within a single test file. Since all async functions use await, the first test will always complete before the second runs. The issue you mentioned would only occur if the variable were shared across different test files, as Jest runs test files in parallel.

In this case, both beforeAll and a separate test would work. I prefer keeping it in a test to allow expect() assertions, making potential setup issues easier to trace.

@ethanzhouyc ethanzhouyc merged commit 8a37199 into project-chip:master Feb 5, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants