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

Dyn 5008 watch node height 4 dictionary #12989

Merged
merged 3 commits into from
Jun 14, 2022
Merged

Dyn 5008 watch node height 4 dictionary #12989

merged 3 commits into from
Jun 14, 2022

Conversation

jesusalvino
Copy link
Contributor

@jesusalvino jesusalvino commented Jun 9, 2022

Purpose

WatchNode height 4 a Dictionary
https://jira.autodesk.com/browse/DYN-5008

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

###Reviewers
@QilongTang

###FYIs
@RobertGlobant20 @filipeotero
Show less

@jesusalvino
Copy link
Contributor Author

imagen

@jesusalvino
Copy link
Contributor Author

dic

@@ -59,7 +60,7 @@ private void _vm_PropertyChanged(object sender, System.ComponentModel.PropertyCh
this.Height = minHeightSize;
if (_vm.Children.Count !=0)
{
if (_vm.Children[0].NodeLabel.Contains(Environment.NewLine))
if (_vm.Children[0].NodeLabel.Contains(Environment.NewLine) || _vm.Children[0].NodeLabel.ToUpper() == nameof(WatchViewModel.DICTIONARY))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could Children[0] ever be null?

Copy link
Contributor

@reddyashish reddyashish Jun 9, 2022

Choose a reason for hiding this comment

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

If just a null value is passed to the watch node, i think the watch node doesn't consider it a child and children could be zero. Can you verify?

Copy link
Contributor Author

@jesusalvino jesusalvino Jun 10, 2022

Choose a reason for hiding this comment

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

Could Children[0] ever be null?

After a lot of debugging at least in the more common scenarios of the WatchNode, In this section of the code when we are dealing with the Iscollection property, no.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If just a null value is passed to the watch node, i think the watch node doesn't consider it a child and children could be zero. Can you verify?

The only way that I found to assign a null value to the WatchNode is being explicit from a Code Block. Per my understanding all the data types that a WatchNode receives always is handled in the first Child[0].

WatchNode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

QilongTang reddyashish Please your thoughts/worries, Maybe I'm missing something like others scenarios, complex data types or whatever, It will be nice to test it in order to be on the same page and prevent Dynamo crashes or unexpected behaviors.

Copy link
Contributor

@reddyashish reddyashish Jun 10, 2022

Choose a reason for hiding this comment

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

It would be hard to tell accurately considering all cases. To be on the safe side, you can just add a additional check before that like:
if(_vm.Children.Count > 0 && ....)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be hard to tell accurately considering all cases. To be on the safe side, you can just add a additional check before that like: if(_vm.Children.Count > 0 && ....)

What do you think about the highlighted line ?
imagen

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I did not see that. Looks good to be merged.

Copy link
Contributor

Choose a reason for hiding this comment

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

In line 63, you can just use the variable NodeLabel you created instead of _vm.Children[0].NodeLabel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@reddyashish reddyashish added this to the 2.15.0 milestone Jun 9, 2022
@QilongTang QilongTang merged commit ba93661 into DynamoDS:master Jun 14, 2022
@QilongTang
Copy link
Contributor

@jesusalvino Please cherry-pick this to RC2.15.0_master branch

QilongTang pushed a commit that referenced this pull request Jun 16, 2022
* WatchTree f Dictionary and Testing

* Watchtree 4 Dictionary Testing resources

* Use of NodeLabel property
QilongTang pushed a commit that referenced this pull request Jun 17, 2022
* Dyn 5008 watch node height 4 dictionary (#12989)

* WatchTree f Dictionary and Testing

* Watchtree 4 Dictionary Testing resources

* Use of NodeLabel property

* Update the License styling (#13021)

* Update the License styling

* Update License txt and rtf

* Removing duplicate entries (#13027)

* Removing duplicate entries

* Removing duplicate entries

* Cleaning the txt LICENSE
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