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

Bug/fix custom xml issues/zapp 1351 #1299

Merged

Conversation

brdandu
Copy link
Collaborator

@brdandu brdandu commented Apr 8, 2024

Reverting the multi protocol commit and fixing custom xml issues on top of it.

This reverts commit 61d328c.

Fixing Custom XML issues:
- Cleaning up the custom xml UI update as well as the custom xml package uploading such that there are no duplicates
- Fixing the custom xml UI for attributes, commands and events when cluster extensions are added through custom xml. Needed the custom xml package ids to be included
- Fixing the duplicate attributes and commands which show up in the attribute and command UI when a custom cluster with custom attributes and commands is added. This is solved by using a set in : reduceAndConcatenateZclEntity(db, id, [...new Set([...standAlonePackageIds, clusterInfo.packageRef])],
- Adding unique constraint to Attribute table and adding insert or replace to attribute insert query such that custom cluster extensions are not reloaded into the db.
- Making sure the global attributes are part of the custom clusters in static-zcl.js while calling reduceAndConcatenateZclEntity
- Making sure that session partition numbering is correct for the partitionNumber column
- For loading custom cluster extensions such as attributes and commands. Making sure they are loaded into the database based on the top level zcl package loaded. This is needed for sdk upgrades or custom xml in multi-protocol. See changes to zcl-loader-silabs and zcl-loader
- When adding custom xml, there are instances where multiple zcl packages are loaded for the same xml file. This was an issue with the mutation observer. Getting the load new package call out of the observer to fix this. Reproducer: Open zap, add custom xml from extensions, close extensions pane, add another xml from extensions and you will see two instances of the xml added. If you add another xml then you see 3 instances. This is fixed in ZclCustomZclView.vue
- Making sure that the delete button appears across custom xml for removal and doing some minor UI cleanup
- Add more unit tests for custom xml
- Cleaning up zap toolbar UI for logos
- JIRA: ZAPP-1351
@brdandu brdandu force-pushed the bug/fixCustomXmlIssues/ZAPP-1351 branch from c14105e to ebe126c Compare April 10, 2024 15:10
Copy link
Collaborator

@tecimovic tecimovic left a comment

Choose a reason for hiding this comment

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

There is a LOT of change here. I am not able to fully review this line by line, but generally, if you've covered all the unit tests with odd custom XML cases, and they are working as expected, then I'm ok with this.

}

return genResult
return genResults
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we return array of results here, instead of just aggregate everything into a single result? The result is generally an additive object, so you can keep adding to it more and more generated template results...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For multi-protocol there can be more than one top level generation packages. Hence the array. Each top level template package can have a gen template package associated with it.

FROM
ENDPOINT AS E1
LEFT JOIN
ENDPOINT AS E2
Copy link
Collaborator

Choose a reason for hiding this comment

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

I got confused by now.... Why exactly do we need the parent-child relationship in the endpoints? What does a "parent endpoint" mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

An endpoint which can be a composition of other endpoints. So that relationship is established by parent endpoints

})
.then(() =>
queryPackage.insertSessionPackage(db, sessionId, packageId)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should rewrite these tests to use await/async instead of the old .then() patterns...

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 agree. We should probably do that for our entire code base.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Logged #1302

@brdandu brdandu merged commit 203522d into project-chip:master Apr 11, 2024
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.

2 participants