-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Improve drive detection and UI sync to deal with duplicate entries #3350
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
Improve drive detection and UI sync to deal with duplicate entries #3350
Conversation
@gave92, PR updated to remove drive ordering. I've realised I didn't see that because my drives are named in a way they end up in order of the drive letters. Can you try and repro the duplication issue by swapping
for
Task.Factory.StartNew doesn't preserve the synchronization context and has caused me issues in the past. This way the drive lists should be fully populated before MainPage is constructed. |
@AndyMDoyle yeah but I really don't want to wait for the sidebar to be fully populated before showing MainPage :) |
@gave92, neither do I really but doing that did get rid of duplication issue for me. Your commit looks great and I can't see any issues on my side. One question though, the existing usage of And in |
Yes, EndBulkOperation() must be called on the UI thread, I should be already doing it, if not please correct :)
I can't believe that xD If you minimize and restore the app without being attached to the debugger are you really not getting a crash? Edit: latest commit fixes the crash after minimize/restore. I'm still interested in knowing whether before this commit you were getting a crash as well |
@gave92, yes I am seeing a crash related to BulkConcurrentObservableCollection.OnCollectionChanged if I run without the debugger. Trying the latest commit now. |
Hi @hez2010 we need your help :) In this PR we were trying to switch the MainPage SidebarItems list from ObservableCollection to the BulkConcurrentObservableCollection. Unfortunately we were getting a crash anytime the Do you understand why the app is crashing? If you wish to test you can checkout commit 5eceb15 (not the latest one). To trigger the bug you can suspend/resume the app (or minimize/restore it with no debugger attached). |
@gave92 everything looks okay when using an ObservableCollection. Release mode starts up nice an quick and the local drives and cloud drives sections appear when ready. |
@gave92 It's caused by a mistake that passing Remove event argument without index. Also it seems that the SideBar underlaying control needs a @AndyMDoyle I've proposed a fix to |
I think this PR is ready for merge. @gave92 could you test again to see if there're still issues remaining or performance degradation about |
@AndyMDoyle Great work! |
#3231
Primary change is making the app service connection a singleton which means multiple messages can be sent without issues launching additional processes. A lot of this has been taken from a @gave92's network drives PR and should make that PR a smaller update.
The logic to add local drives and cloud drives to the side bar has also been refactored to ensure this is done on the UI thread and that a lock is obtained to prevent multiple updates to the side bar items at the same time. Now a lot of the code is async, this is done using a
SemaphoreSlim
to ensure one thread at a time updates the side bar items.So far this update has been 100% reliable in debug mode, release mode, and with SharePoint sync folder support on top which results in an additional concurrent full trust call at startup.