Skip to content

Conversation

@aparajit-pratap
Copy link
Contributor

@aparajit-pratap aparajit-pratap commented Mar 14, 2018

Purpose

Fixes QNTM-3279 and QNTM-3287.

One of these is a crash when typing something like Point.X in a CBN and committing it. The reason being that the statement gets compiled to Point.X() and is passed a default argument. An assertion was made in the marshaler that the argument could only be a pointer and function pointer. For the time being I have also included the possibility of this argument being a default argument to prevent the crash. A more detailed investigation needs to be made as to the origin of this default argument. Ideally there should be no default argument generated and the function call should report a method resolution warning or something similar.

The second fix is to compile property calls using class names like Dictionary.Count(dict);. This wasn't supported previously as it would only work with a static getter, namely, Dictionary.get_Count(dict); which is an internal method not exposed to users. Also this fixes node to code operations on query nodes to appropriately display the method call without the getter:
image
image

Declarations

Check these if you believe they are true

  • The code base 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.

Reviewers

@pboyer

FYIs

@kronz @jnealb

@pboyer
Copy link
Contributor

pboyer commented Mar 14, 2018

The fact that we haven't found the origin of QNTM-3279 is somewhat unsettling to me. I think I'm okay with this change if:

  1. there's a task to find the underlying issue
  2. it's going to be worked on immediately

Hence, this change is a "hot fix". Regardless, we need a test for this fix to prevent regression.

The latter change is fine and thanks for the test.

@aparajit-pratap
Copy link
Contributor Author

aparajit-pratap commented Mar 15, 2018

@pboyer thanks for the review. Created a task for the proper fix for the crash: https://jira.autodesk.com/browse/QNTM-3696. I think the correct behavior is to create a function pointer for a statement like a = Point.X; so that it can be called at a later point in time as a(ptObj);. This is the behavior for all other static method calls other than properties. I have already included a test to check against the crash.

@aparajit-pratap aparajit-pratap merged commit bc67501 into DynamoDS:master Mar 15, 2018
@aparajit-pratap aparajit-pratap deleted the fixStaticProperty branch March 15, 2018 14:54
aparajit-pratap added a commit to aparajit-pratap/Dynamo that referenced this pull request Mar 15, 2018
* fix crash, compilation of static property

* code cleanup

* add test

* add test graph
ramramps added a commit that referenced this pull request Mar 15, 2018
saintentropy added a commit that referenced this pull request Oct 24, 2018
* Add RegisterFroTrace attribute as a trigger in Json serialization of trace

* PR comment

* [ 2.0 Release Cut ] Bump Up Master Patch Version (#8647)

* Bump Up Patch Version

* Add version

* Update comments and version baseline

* Address Comments

* CubicMillimeterToCubicMeter conversion

* Revert "CubicMillimeter To CubicMeter conversion"

* Fix the units bug

* Remove thread sleep

* missed the test

* Fix static property compilation and crash (#8649)

* fix crash, compilation of static property

* code cleanup

* add test

* add test graph

* QNTM-3646: Fix creation of unwanted input port for list index-assignment (#8648)

* fix for additional input port

* fixes for output ports

* update tests

* added test, code cleanup

* address review comments

* QNTM-3279: Fix for crash when trying to directly call properties on class name (#8661)


* fix for compiling property method as function pointer

* code cleanup

* add tests

* Cherry-pick #8663  (#8664)

* Update failing tests (#8663)

* update tests

* Merge LibG binaries with Geometry.Approximate API (#8666)

* merge LibG binaries with Geometry.Approximate()

* Update license

* scroll bar fix in incanvas search

* QNTM-3641: Prevent ColorRange node from crashing with old style List syntax (#8670) (#8674)

* fix crash with ColorRange1D node

* add test

* add test
set unsaved changes false when initializing json custom node

* Update changes from librarie.js to fix QNTM-3710 (#8678)

After investigating the errors in the EngOps check it was thought that these changes could not have caused the current failures. Other PRs have also shown the same issues. Given all of that, this PR is being merged.

* address comments

* Update LibG binaries for ASM224 branch (#8681)

* update LibG binaries for ASM224 branch

* PR comment

* QNTM-3841 Add geometry creation option to Dynamo CLI (#8775)

* POC

* Cleanup code.

* Add command line option -g for generating geometry json file.

* Remove filtering

* Fix node state flags at load time.

* Use UpdateValue for setting isVisible on node model. Revert set to private.

* Remove filtering.

* Clean up holder code.

* Cleanup converter code. Use node model defaults as starting point.

* Preload the same libraries for CLI as for Sandbox.

* Add color support

* Simplify json

* Update file format.

* Remove property expressions.

* Restore comment.

* Restore Cef Settings

* Add unit test for CLI geometry option.

* Remove comment.

* Don't extend CommandLineRunner.

* Use var when possible.

* Remove commented out code.

* Use DynamoViewModel in CLI.

* Use DefaultWatch3DViewModel for CLI.

* Add new project DynamoWPFCLI.

* Let CommandLineRunnerWPF inherit from CommandLineRunner.

* Fix review comments.

* Fix unstable unit tests.

* Remove Dispose method.

* Add comments

* Fix type check

* Apply same fix to NodeInputData

* Add serialization tests

* Fix typo in Extansion.

* QNTM-4278 DynamoWPFCLI should use CoGs geometry format (#8887)

* POC

* Cleanup code.

* Add command line option -g for generating geometry json file.

* Remove filtering

* Fix node state flags at load time.

* Use UpdateValue for setting isVisible on node model. Revert set to private.

* Remove filtering.

* Clean up holder code.

* Cleanup converter code. Use node model defaults as starting point.

* Preload the same libraries for CLI as for Sandbox.

* Add color support

* Simplify json

* Update file format.

* Remove property expressions.

* Restore comment.

* Restore Cef Settings

* Add unit test for CLI geometry option.

* Remove comment.

* Don't extend CommandLineRunner.

* Use var when possible.

* Remove commented out code.

* Use DynamoViewModel in CLI.

* Use DefaultWatch3DViewModel for CLI.

* Add new project DynamoWPFCLI.

* Let CommandLineRunnerWPF inherit from CommandLineRunner.

* Fix review comments.

* Fix unstable unit tests.

* Remove Dispose method.

* Add comments

* First pass

* Formatting fixes.

* Remove XML stuff.

* Some final adjustments.

* Add more comments.

* Move comment.

* Only store the geometry array.

* Refactor.

* Add interface

* Make interface internal

* Rename implmentation.

* Allow internal access for CLI

* Move default implementation to core.

* Make setters private

* Address review comments.

* match Revit CEF intitializtion settings

* match Revit CEF intitializtion settings

* match Revit CEF intitializtion settings

* QNTM-5580 - Correct Typo in the Dynamo json serialization to match CoGS API (#9170)

* Fix typo

* Obsolete the existing property

* Update test

* remove expression body syntax

* Add serialization test with typo

* AVP NumberInputNode deserialization

* add testing

* QNTM-5568 Refinery needs to support culture invariance for number fmt, part Deux (#9178)

* Don't culture format value strings.

* Assume value strings are formated with `InvariantCulture`

* Add tests

* More work on tests

* Clarify switching of cultures
@horatiubota horatiubota added the error/warning/crash Issues mentioning a Dynamo error, warning or crash message label Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error/warning/crash Issues mentioning a Dynamo error, warning or crash message

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants