Skip to content

Conversation

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Aug 5, 2025

Fixes #53659

When you try to download files from which at least one has been removed from it's federated source, the lockFiles method will mark the storage as unavailable and lock the file in a stale state preventing any further operations.

By getting the fileInfos before, we are able to set-up the mounts before and removing federated shares (mounts) if they are unavailable.

Since 31, the ajax plugin has been removed and the download path have changed, this is only for 29 and 30.

Here is two json stacktrace that show how it used to behave before this patch and how it is supposed to (if you download the file via remote.php/dav, without the zip plugin)
https://gist.github.com/skjnldsv/c8ae6b701f5467984ce0f552e22c5953

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv self-assigned this Aug 5, 2025
@skjnldsv skjnldsv changed the title fix(lib): get fileinfo before locking [stable29] fix(lib): get fileinfo before locking Aug 5, 2025
@skjnldsv
Copy link
Member Author

skjnldsv commented Aug 5, 2025

/backport! to stable30

@icewind1991
Copy link
Member

This could lead to a race condition if the size of any of the files changes between collecting the fileinfos and the moved lock call. Not sure that the effect would be though

@skjnldsv
Copy link
Member Author

skjnldsv commented Aug 5, 2025

This could lead to a race condition if the size of any of the files changes between collecting the fileinfos and the moved lock call. Not sure that the effect would be though

That's the easier approach I could find that made sense to me.
We could also add some more checks to how we do the file lock I guess, but this is also an old deprecated File class 🤷 🤔

@skjnldsv skjnldsv requested review from a team, Altahrim, come-nc, icewind1991 and susnux and removed request for a team August 5, 2025 18:53
@joshtrichards joshtrichards linked an issue Aug 6, 2025 that may be closed by this pull request
8 tasks
@AndyScherzinger AndyScherzinger merged commit 898facd into stable29 Aug 20, 2025
184 of 195 checks passed
@AndyScherzinger AndyScherzinger deleted the fix/download-invalid-share branch August 20, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Federated shares don't dissapear when file deleted

4 participants