Conversation
|
A wpf control can trigger Loaded event multiple times (some without DataContext) Here is the callstack caught with GFlags |
|
I still did not figure out why the exception is not caught by sandbox... |
| private readonly int minHeightSize = 38; | ||
|
|
||
| public WatchTree() | ||
| public WatchTree(WatchViewModel vm) |
There was a problem hiding this comment.
this should be ok to break right ?
|
@pinzart90 what is the actual exception? Is something null? |
The _vm (WatchViewModel) is null You might be right about the crash handler... |
| this.watch = nodeModel; | ||
| this.syncContext = new DispatcherSynchronizationContext(nodeView.Dispatcher); | ||
|
|
||
| var watchTree = new WatchTree(); |
There was a problem hiding this comment.
Is any of this code new to 2.15 that causes this to fail only in 2.15?
There was a problem hiding this comment.
Hard to tell by looking at the code...multiple things can contribute to this bug
The critical area (IMO) is the Loaded event ...that assumes a DataContext exists. That part of the code has been there for a while.
The loaded event can be triggered multiple times with/without data context. Looks like at least in 2.15...a Loaded event is triggered without data context (when opening the .dyn attached to the jira task)
This seems to be acceptable (from what I have read) but we should not always assume the context exists.
The exception does not trigger when the debugger is attached. |
|
LGTM! |
|
I removed the new unit test because it did not reproduce the issue (without the code fix). |
|
let's not merge this until we remove the 3 megabyte file which no longer reproduces the bug - I will remove it. |
|
I also can't reproduce this with either test file, in my tests it seems watchTree_loaded is now only called once, but the changes make sense to me and seem easier to reason about than what was happening previously. I'm going to merge this and monitor for any regressions. |
https://jira.autodesk.com/browse/DYN-5005
Purpose
Fix silent crash when opening up graph
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of