Bug 58917 - Xwt TreeView does not reliably display root elements
Summary: Xwt TreeView does not reliably display root elements
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS Designer ()
Version: 4.6.0 (15.3)
Hardware: PC Windows
: High blocker
Target Milestone: 15.5
Assignee: Alexander Sorokin
URL:
: 59027 ()
Depends on:
Blocks:
 
Reported: 2017-08-21 08:51 UTC by Paul Sinnema
Modified: 2017-10-10 10:54 UTC (History)
13 users (show)

Tags: Akvelon
Is this bug a regression?: ---
Last known good build:


Attachments
Shows empty document outline (84.72 KB, image/png)
2017-08-21 08:51 UTC, Paul Sinnema
Details
Shows empty doment outline (101.12 KB, image/png)
2017-08-21 08:54 UTC, Paul Sinnema
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Paul Sinnema 2017-08-21 08:51:29 UTC
Created attachment 24320 [details]
Shows empty document outline

When I open a .xib and also the Document Outline the last shows no content at all.

Version information:

Microsoft Visual Studio Professional 2017 
Version 15.3.1
VisualStudio.15.Release/15.3.1+26730.8
Microsoft .NET Framework
Version 4.7.02046

Xamarin   4.6.0.295 (306f76a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.4.0.19 (0cd0214)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.12.0.14 (bf350ba)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Paul Sinnema 2017-08-21 08:54:52 UTC
Created attachment 24321 [details]
Shows empty doment outline

Sorry, added wrong attachement. Here's the correct one.
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-24 22:43:09 UTC
*** Bug 59027 has been marked as a duplicate of this bug. ***
Comment 3 Jon Goldberger [MSFT] 2017-08-31 18:56:15 UTC
It might be worth noting that if you drag a UIViewController onto the XIB canvas, the UIViewController does show in the document outline. So it would seem that iOS Designer is not adding UIViews that are not in a UIViewController to the document outline.
Comment 4 theaufty 2017-09-01 15:16:55 UTC
Note: If I change to another tab and come back to the xib tab I can see the document outline again.
Comment 5 Alexander Sorokin 2017-09-18 11:01:58 UTC
Fixed in https://github.com/mono/xwt/pull/722
Comment 6 Alan McGovern 2017-09-20 16:51:25 UTC
The patch had to be reverted as it triggered crashes in WPF. We'll have to solve this another way. This sounds like it requires intimate knowledge of the XWT layout engine so perhaps this would be better off assigned to someone who understands it?

I attached screenshots and the stacktrace to the original PR and reverted the commit from master already.

https://github.com/mono/xwt/pull/722
Comment 7 Alan McGovern 2017-09-20 16:53:55 UTC
As an alternative take on the original patch I tried to move the UpdateLayout call to another place, but it also does not work as expected. If you drag one viewcontroller then it doesn't show up in the treeview. If you drag a second one then the first viewcontroller will show up in the treeview. If you drag a third one then you'll see the first two ViewControllers in the panel.

https://gist.github.com/alanmcgovern/f163eb525e601897b5f27f241c5e5d76
Comment 8 Alan McGovern 2017-09-21 17:02:23 UTC
I believe the crash we're experiencing is caused by this re-entrancy:

https://gist.github.com/alanmcgovern/aebe0fe47a68cfdd1429397b6d8f5d11#file-gistfile1-txt-L48-L86

We should not be re-entrantly calling ItemContainerGenerator like this. We're adjusting the child collection while we're adjusting the child collection.
Comment 9 Alexander Sorokin 2017-09-25 08:27:51 UTC
Hey Alan, as far as I know you've reverted the original commit that caused the issue. What should we do with this bug?
Comment 10 Alan McGovern 2017-09-25 10:29:37 UTC
I haven't reverted the original patch which seems to have introduced the issue. I was hoping someone more familiar with the code could make a better attempt to fix the issue with the additional information we have now.

If they can't then reverting the commit which broke the panel seems like the way forward, but we'd have to test it thoroughly before we commit it to make sure nothing breaks.

Just in case that ends up being what we do - can you revert that original commit locally and give it a thorough check to make sure it doesn't cause other unexpected crashes?
Comment 11 xamarin-release-manager 2017-09-26 16:52:55 UTC
Fixed in version 4.8.0.554 (d15-5)

Author: Alexander Sorokin
Commit: 2975e87e04cb32e0801a70a2e47090a740d83db3 (mono/xwt)
Included in Commit: 023734e3dfb9914ee6459ee15aea131351c2f42d (xamarin/XamarinVS)
Comment 12 Alan McGovern 2017-09-26 17:08:42 UTC
We reverted the original change which appears to remove the re-entrancy we saw in comment 8