Skip to content
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

Remove part files when upload is cancelled for all public links #36761

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

sharidas
Copy link
Contributor

Remove the part files when upload is cancelled for
the public links.

Signed-off-by: Sujith H sharidasan@owncloud.com

Description

When user tries to upload files to public links with Upload Only or Download / View / Upload and cancels when the files are uploaded:
Then it is noticed that the part files are not cleaned up properly.
So this change would help to clean up the part files even though the upload is cancelled for the public links.

Related Issue

  • Fixes enterprise ticket 3637

Motivation and Context

This change set helps to clean up the part files when the uplaod is cancelled for the public links.

How Has This Been Tested?

  • Tested and verified manually for the public links
    • Upload Only
    • Download / View / Upload

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@sharidas sharidas self-assigned this Jan 14, 2020
@update-docs
Copy link

update-docs bot commented Jan 14, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@sharidas sharidas added this to the development milestone Jan 14, 2020
@sharidas sharidas requested a review from jvillafanez January 14, 2020 11:43
@jvillafanez
Copy link
Member

Code looks good to me. We need to check the CI. In addition, check if it's easy to include an unittest for the change

@phil-davis
Copy link
Contributor

changelog needs an issue or PR link:
https://drone.owncloud.com/owncloud/core/22632/3/2

file changelog/unreleased/36761: primary issue ID not found

until that is fixed, the "real" CI is not going to run

@sharidas sharidas force-pushed the remove-partfiles branch 2 times, most recently from 6463283 to 31a9e75 Compare January 14, 2020 12:42
@codecov
Copy link

codecov bot commented Jan 14, 2020

Codecov Report

Merging #36761 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #36761   +/-   ##
=========================================
  Coverage     64.68%   64.68%           
- Complexity    19120    19121    +1     
=========================================
  Files          1269     1269           
  Lines         74778    74778           
  Branches       1320     1320           
=========================================
  Hits          48372    48372           
  Misses        26018    26018           
  Partials        388      388
Flag Coverage Δ Complexity Δ
#javascript 54.12% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.85% <100%> (ø) 19121 <0> (+1) ⬆️
Impacted Files Coverage Δ Complexity Δ
.../private/Files/Storage/Wrapper/PermissionsMask.php 93.02% <100%> (ø) 40 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64ee624...aea03bd. Read the comment docs.

@@ -75,6 +75,14 @@ public function testUnlinkNoDelete() {
$this->assertTrue($storage->file_exists('foo'));
}

public function testUnlinkPartFiles() {
$file = 'foo.txt.part';
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check without delete permission

Remove the part files when upload is cancelled for
the public links.

Signed-off-by: Sujith H <sharidasan@owncloud.com>
@sharidas sharidas merged commit 7b574e7 into master Jan 17, 2020
@delete-merged-branch delete-merged-branch bot deleted the remove-partfiles branch January 17, 2020 06:38
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.

3 participants