aardvark.media
aardvark.media copied to clipboard
MutableApp.toWebPart is blocking the application
MutableApp.toWebPart is the default entry used in most demos and applications. This also builds a renderer : Server with fileSystemRoot = Some "\" (https://github.com/aardvark-platform/aardvark.media/blob/master/src/Aardvark.UI/MutableApp.fs#L128).
On Windows this then performs a GetAllDrives and then tries to enumerate all files, but only to check if it is empty: https://github.com/aardvark-platform/aardvark.media/blob/master/src/Aardvark.Service/aardfs/FileSystem.fs#L189
There are scenarios with network drives that then result in blocking the application startup seemingly indefinitely (continuing after 10-12mintures). When the network drives that cause the issue are inspected with a windows file explorer it's also "looking" for a very long time without any progress.
I'm not sure if the root path "" should be considered valid. From my analysis, I would see two tasks:
- It should be possible to deactivate this feature or even require it to be activated explicitly
- The default behavior should no longer enumerate all drives + files on startup
i would opt for making it optional. For production the browser needs to be reworked (possibly as addon-not core) anyways...
As quick fix it might be feasible to either make "rootEntries" lazy or query the "rootEntries" every time in GetEntries. In my application, this will then never get called, while it should not change the current behavior.
It sounds reasonable to require that the inclusion of a FileBrowser needs to be specified on the user/app side. Our "14 - OpenFile" example seems to be a suitable playground for this.
I've created a new version that delays the enumeration of all drives. This resolves the issue for me since the function then is never run.