-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fixup preview issues with trashbin/versions #34283
Conversation
Codecov Report
@@ Coverage Diff @@
## master #34283 +/- ##
============================================
+ Coverage 65.11% 65.15% +0.04%
- Complexity 18338 18352 +14
============================================
Files 1199 1200 +1
Lines 69634 69698 +64
Branches 1283 1283
============================================
+ Hits 45340 45413 +73
+ Misses 23920 23911 -9
Partials 374 374
Continue to review full report at Codecov.
|
b7228de
to
4cd2eda
Compare
1bc87b2
to
eb05df4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
I wonder if this is enough as there might be other code paths related to trashbin: try having version previews for files that were deleted in trashbin, the trigger trashbin expiration. This will like trigger https://github.com/owncloud/enterprise/issues/3067 and might trigger some other hook methods.
I like how you refactored the static methods to be able to write tests! |
codecov however seems less enthusiastic... and fails to load 😡 |
@PVince81 |
@PVince81
here is log (nothing fishy)
So there is nothing to fix for the trashbin IMO unless such agressive deletion of preview is unexpected |
The fix is incomplete, preDelete hook should also have the same changes. |
80a8195
to
806866d
Compare
I seem to remember that the code was deleting more than just the expected previews, which is a bit brutal. Can you recheck the exact path that is getting deleted from the code ? |
it's due |
8749a66
to
47c0735
Compare
@PVince81 description updated to describe 3 bugs that are already fixed in this PR. |
I'll list my expectations here. This is how the things work within this PR:
|
@PVince81 please rereview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@VicDeo please backport |
stable10: #34533 |
Description
uid
is always known - pass it within theversion_delete
hook infooriginal_path
that contains a path to the versioned fileand
deleted_revision
- versionId for the deleted versionversionId
to deleteAllPreviews when we need to remove previous for the specific version onlyRelated Issue
https://github.com/owncloud/enterprise/issues/2904
Motivation and Context
How Has This Been Tested?
Case 1
Expected result
version previews for cleaned up versions are deleted
No errors
Actual result
version previews for cleaned up versions are NOT deleted
Case 2
Expected result
Only file previews are deleted
Actual result
File previews and all versions previews are deleted
Case 3
delete a directory with a file and browse to the file in the trashbin
Expected result
File in deleted directory has a prievew
Actual result
No file preview
Types of changes
Checklist:
Open tasks: