-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Refresh does not remove volumes not available anymore #3689
Comments
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.
blutorange
pushed a commit
to blutorange/elFinder
that referenced
this issue
Dec 15, 2024
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.
This issue is stale because it has been open for 50 days with no activity. |
Please keep open, there's also a PR for review. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: