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
Mount an external storage (ex: SMB) as "/smb" system-wide, apply to all users
Login as any user
Create a file "/smb/test.txt"
Edit the file and save many times to create 10-20 versions
Check the version files for that user: find data/user1 -iname \*.v\*
update oc_jobs set last_run=0
Run cron.php
Expected result
Some version expired
Actual result
No versions expired.
Versions
ownCloud 9.0.1
The reason is because the expire() method calls getUidAndFilename and the external storage has no owner, so it bails out with NoUserException without doing any expiration.
According to @schiesbn, versions on system-wide ext storage are always specific to the current user viewing the folder. So the correct logic would be to make it fallback to the user that was specified in the expire job.
Looks like the code in getUidAndFilename is very old, it assumes that the owner can be another user. This is obsolete because since the introduction of expire background jobs, we only ever expire for the user specified in the expire job. For shared folders, the expire job is only created for owners even when a recipient edited a file.
This means that as part of this fix we can get rid of getOwner() and always use the expire job user.
It would also fix the case with external storage where we need to use that user too.
Steps
find data/user1 -iname \*.v\*
update oc_jobs set last_run=0
Expected result
Some version expired
Actual result
No versions expired.
Versions
ownCloud 9.0.1
The reason is because the
expire()
method callsgetUidAndFilename
and the external storage has no owner, so it bails out withNoUserException
without doing any expiration.According to @schiesbn, versions on system-wide ext storage are always specific to the current user viewing the folder. So the correct logic would be to make it fallback to the user that was specified in the expire job.
CC @nickvergessen @VicDeo
The text was updated successfully, but these errors were encountered: