Description
Describe the bug
Volumes may stop being available (such as virtual volumes from a database and the volume was deleted from the database by another user). Doing a reload should detect this case and remove the volume, but currently, it does not.
To Reproduce
Open ElFinder with several volumes. Do something on the server that results in one volume not being available anymore. Right click -> Reload
or call fm.sync
on the file manager instance.
Expected behavior
ElFinder makes an open
request to server, with tree = 1
. The server replies with a list of all volumes.
If a volume is missing in the response from the server, ElFinder should remove that volume from the UI.
Additional context
ElFinder already checks for removed files / volumes when fm.sync
is called. However, there's this part:
Lines 2507 to 2527 in 7544918
Where ElFinder merged the roots it already knows about into the response. If I understand it correctly, it should not do that for the open command with tree = 1
, as the server will already return all available volumes.
Adding a simple check so that it only calls pushLeafRoots
when tree != 1
seems to solve the issue -- the volume gets removed.
Here's a demonstration where another user removes a volume. In the first request, the server still returns the volume New theme 4
. After it was deleted, the server does not return it anymore. After adding the above-mentioned check, refreshing removes the volume:
Activity