-
Notifications
You must be signed in to change notification settings - Fork 23
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
Delete thumbnail even if file is not to be deleted #679
Conversation
Codecov Report
@@ Coverage Diff @@
## staging #679 +/- ##
===========================================
+ Coverage 22.00% 22.02% +0.01%
===========================================
Files 69 69
Lines 7930 7933 +3
===========================================
+ Hits 1745 1747 +2
- Misses 5923 5924 +1
Partials 262 262
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -76,7 +81,7 @@ func (nf *DeleteFileChange) CommitToFileStore(ctx context.Context) error { | |||
Where("allocation_id=? AND content_hash=?", nf.AllocationID, res.ContentHash). | |||
Count(&count) | |||
|
|||
if count != 0 { | |||
if count != 0 && res.ThumbnailHash == "" { |
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.
I would suggest to use res.ThumbnailSize ==0
instead of res.ThumbnailHash == ""
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.
LGTM
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.
lgtm
Fixes
Even if there are content sharing
refs
, they are not supposed to sharethumbnail
. So if delete operation is called, thumbnail should be deleted regardless