-
Notifications
You must be signed in to change notification settings - Fork 635
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
Hide All context menu in workspace when displaying node context menu #12565
Hide All context menu in workspace when displaying node context menu #12565
Conversation
} | ||
|
||
[Test] | ||
[Category("UnitTests")] | ||
public void UpdateModelValue_EmptyList_ThrowsException() | ||
{ | ||
var command = new DynCmd.UpdateModelValueCommand(Guid.Empty, new Guid[] { }, "", ""); | ||
Assert.Throws<ArgumentNullException>(() => CurrentDynamoModel.ExecuteCommand(command)); | ||
Assert.Throws<ArgumentNullException>(() => CurrentDynamoModel.CurrentWorkspace.UpdateModelValue(command.ModelGuids, | ||
command.Name, command.Value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aparajit-pratap Let me know if you have a strong opinion on this. In my opinion, this should not crash Dynamo but currently, it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remind me how these exceptions can be reproduced exactly? Looking at that old PR, I see that these exceptions are thrown when either the nodemodel is not found in the workspace or the list of nodemodels passed is null or empty, but how exactly can these situations be reproduced.
command.Name, command.Value); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Logger.LogError(ex.Message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what kinds of exceptions are these and why are they thrown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is code inside the function UpdateModelValue
that throw the invalid operation exception, but they are not caught anywhere. In that case, Dynamo will simply crash
{ | ||
ShowHidePopup(ShowHideFlags.Hide, PortContextMenu); | ||
ShowHidePopup(ShowHideFlags.Hide, NodeAutoCompleteSearchBar); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if the sender is not the nodeview (if it's the workspace), the node level popups can still be open?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the intended design from UX originally. e.g. if node autocomplete is triggered, but user clicking on canvas, the node autocomplete dialog should remain open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think overall it's better to catch unhandled exceptions that would otherwise lead to a crash. Just one question as to steps that a user would follow in Dynamo that would lead to these crashes earlier?
Yes, @aparajit-pratap You can refer to #12532, although it should be avoided by my PR but I think catching the exception would be better than just leaving it as it is. Let me know |
…12565) * Hide All context menu in workspace when displaying node context menu * Fix the crash for lacing menu * fix unit tests
Please Note:
DynamoRevit
repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTM
label is added to the PR.Purpose
Per https://jira.autodesk.com/browse/DYN-4509, https://jira.autodesk.com/browse/DYN-4459 and #12532, fixing the issue that other popups are not hidden when displaying the node context menu. This fact will create all kinds of weird interactions.
UpdateModelValueImp
should not crash Dynamo. Catching the exception and logging it to Dynamo consoleDeclarations
Check these if you believe they are true
*.resx
filesRelease Notes
Hide All context menu in workspace when displaying node context menu
Reviewers
@reddyashish @zeusongit
FYIs
@johnpierson