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-7531 Catch WebView2 initialization exception #15685

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1427,21 +1427,28 @@ private void LoadHomePage()
{
if (homePage == null && (startPage != null))
{
homePage = new UI.Views.HomePage();
Copy link
Contributor

Choose a reason for hiding this comment

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

if we handle the crash, will Dynamo be able to continue running ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

If the home page is not shown, can Dynamo still be used ?

homePage.DataContext = startPage;

var visibilityBinding = new System.Windows.Data.Binding
try
{
RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(DynamoView), 1),
Path = new PropertyPath("DataContext.ShowStartPage"),
Mode = BindingMode.OneWay,
Converter = new BooleanToVisibilityConverter(),
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
homePage = new UI.Views.HomePage();
homePage.DataContext = startPage;

var visibilityBinding = new System.Windows.Data.Binding
{
RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(DynamoView), 1),
Path = new PropertyPath("DataContext.ShowStartPage"),
Mode = BindingMode.OneWay,
Converter = new BooleanToVisibilityConverter(),
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};

BindingOperations.SetBinding(homePage, UIElement.VisibilityProperty, visibilityBinding);
BindingOperations.SetBinding(homePage, UIElement.VisibilityProperty, visibilityBinding);

this.newHomePageContainer.Children.Add(homePage);
this.newHomePageContainer.Children.Add(homePage);
}
catch (Exception ex)
{
Log(ex.Message);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

any idea what exactly is crashing?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with @pinzart90 we should know why/what is crashing.
I have seen several times that when opening the latest Dynamo (3.4 or 3.3) the HomePage is NOT being shown and instead the old one is shown but I didn't know exactly why (although is not always happening).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RobertGlobant20 @pinzart90 I have removed the feature flag checking code for DynamoHome in 3.4 release, in that case, Dynamo home would always be the default. In the case it was not initialized correctly, then we display the legacy home. Adding such exception logging would help us understand why it was not working

}
}

Expand Down
Loading