You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
Screencast.from.2024-12-13.20-31-25.webm
The text was updated successfully, but these errors were encountered:
blutorange
pushed a commit
to blutorange/elFinder
that referenced
this issue
Dec 13, 2024
When a request is made to the server with the open command and tree=1,
the server must reply with a list of all volumes. If the server's
response does not include a volume ElFinder already knows about, that
volume should be treated as not available anymore and get removed
from the file explorer UI.
This is an amendment to the previous commit. When invoking the refresh
action on a non-root folder, ElFinder also makes a "tree" request to the
server and adds all root volumes it currently knows about. Sinc other
parts of the code might rely upon this behavior (such as tree.js), remove
non-existent volumes from the response to the tree command in the fm.sync
method.
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 callfm.sync
on the file manager instance.Expected behavior
ElFinder makes an
open
request to server, withtree = 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:elFinder/js/elFinder.js
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
whentree != 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:Screencast.from.2024-12-13.20-31-25.webm
The text was updated successfully, but these errors were encountered: