aardvark-platform / aardvark.media

Serverside, functional (ELM style) front-end and UI for Aardvark, an open-source platform for visual computing, real-time graphics and visualization.
https://aardvarkians.com/
Apache License 2.0
47 stars 14 forks source link

MutableApp.toWebPart is blocking the application #39

Open luithefirst opened 3 years ago

luithefirst commented 3 years ago

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:

  1. It should be possible to deactivate this feature or even require it to be activated explicitly
  2. The default behavior should no longer enumerate all drives + files on startup
haraldsteinlechner commented 3 years ago

i would opt for making it optional. For production the browser needs to be reworked (possibly as addon-not core) anyways...

luithefirst commented 3 years ago

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.

luithefirst commented 3 years ago

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.