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

properly tagging storage option based on zcl.json #1140

Merged
merged 5 commits into from
Sep 15, 2023

Conversation

paulr34
Copy link
Collaborator

@paulr34 paulr34 commented Sep 14, 2023

@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2023

Codecov Report

Merging #1140 (35e4480) into master (142858f) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1140      +/-   ##
==========================================
- Coverage   65.21%   65.20%   -0.01%     
==========================================
  Files         170      170              
  Lines       18213    18214       +1     
  Branches     3922     3923       +1     
==========================================
  Hits        11877    11877              
- Misses       6336     6337       +1     
Files Changed Coverage Δ
src-electron/db/query-config.js 80.50% <ø> (ø)
src-electron/zcl/zcl-loader-silabs.js 94.43% <100.00%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

@paulr34 paulr34 merged commit 34f287f into project-chip:master Sep 15, 2023
12 checks passed
@@ -560,6 +560,7 @@ function prepareCluster(cluster, context, isExtension = false) {
if (context.listsUseAttributeAccessInterface && attribute.$.entryType) {
storagePolicy = dbEnum.storagePolicy.attributeAccessInterface
} else if (
context.listsUseAttributeAccessInterface &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? The attributeAccessInterfaceAttributes bit is not dependent on what lists do, is it?

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 actually thought this was a boolean that indicated whether or not the attributeAccessInterface was to be referenced or not but now I understand that attribute lists should ALSO be external. Will fix in a follow up. Thank you.

staticAttribute.storagePolicy ==
dbEnum.storagePolicy.attributeAccessInterface
) {
staticAttribute.storagePolicy = dbEnum.storageOption.external
Copy link
Contributor

Choose a reason for hiding this comment

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

This is mixing up storage policy (which can be "any" or "attributeAccessInterface") and storage option, which can be "external", "ram", "nvm". See also #367

So what I would suggest is that instead of storing "storage option" values in a field that stores storage policy, instead we just use a local variable for the storage option to use for our db insert.

Incidentally, when I was looking over this setup, the resolve method on storagePolicy in db-enum.js is broken: it has storagePolicy.attributeAccess where it should have storagePolicy.attributeAccessInterface, no? Not directly relevant to this PR, but we should fix it here or in a followup.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree, I will make a follow up PR. Thank you.

@bzbarsky-apple
Copy link
Contributor

Also @paulr34 this does not in fact fix #543. What was it trying to fix?

@paulr34
Copy link
Collaborator Author

paulr34 commented Sep 15, 2023

@bzbarsky-apple it fixes this #1110 but in my opinion it was the first step in the natural progression of fixing all of the attribute storage issues. The front end needs to reflect reality before I can fix anything else. Will work on that one ASAP.

@paulr34
Copy link
Collaborator Author

paulr34 commented Sep 15, 2023

also @bzbarsky-apple this issue #543 I have this one fixed locally but it requires me to change the XML files. Working on making a couple PR's.

@bzbarsky-apple
Copy link
Contributor

@bzbarsky-apple it fixes this #1110

Saying that in the description, or at least linking the issue would have been helpful. No idea how someone is supposed to review a PR if it does not say what it's trying to do.

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.

5 participants