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

Add symfony event for resolving private links by apps #30795

Merged
merged 2 commits into from
Mar 26, 2018

Conversation

PVince81
Copy link
Contributor

Description

Apps can now resolve private links whenever the link was not resolvable by the files app.

Currently only the trashbin is responding to this in case a file is in trash.

Related Issue

Will be required for #30106 to also resolve file id to pending share page URL

Motivation and Context

Will be required for #30106 to also resolve file id to pending share page URL.
Also decouples the ViewController from trashbin...

How Has This Been Tested?

Manual test by opening a private link pointing at a trashed folder: the web UI opens in the trashed folder.
Unit tests.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Apps can now resolve private links whenever the link was not resolvable
by the files app.

Currently only the trashbin is responding to this in case a file is in
trash.
@PVince81 PVince81 added this to the development milestone Mar 15, 2018
@PVince81 PVince81 self-assigned this Mar 15, 2018
@PVince81 PVince81 mentioned this pull request Mar 15, 2018
19 tasks
@PVince81
Copy link
Contributor Author

Wow, seems that little change broke a lot of tests...

@PVince81 PVince81 force-pushed the privatelink-resolve-dispatcher branch from 7c70e29 to 18b20de Compare March 19, 2018 11:02
@codecov
Copy link

codecov bot commented Mar 19, 2018

Codecov Report

Merging #30795 into master will increase coverage by 0.01%.
The diff coverage is 81.63%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #30795      +/-   ##
============================================
+ Coverage     61.97%   61.99%   +0.01%     
- Complexity    18358    18378      +20     
============================================
  Files          1157     1157              
  Lines         69066    69117      +51     
  Branches       1242     1242              
============================================
+ Hits          42805    42848      +43     
- Misses        25889    25897       +8     
  Partials        372      372
Flag Coverage Δ Complexity Δ
#javascript 52.33% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 63.08% <81.63%> (+0.01%) 18378 <11> (+20) ⬆️
Impacted Files Coverage Δ Complexity Δ
apps/files_trashbin/appinfo/app.php 54.54% <0%> (-12.13%) 0 <0> (ø)
apps/files/lib/Controller/ViewController.php 91.03% <100%> (+0.06%) 25 <0> (-2) ⬇️
apps/files_trashbin/lib/AppInfo/Application.php 72.72% <25%> (-27.28%) 5 <2> (+2)
apps/files_trashbin/lib/Trashbin.php 77.35% <96.15%> (+1.16%) 146 <9> (+9) ⬆️
apps/files_sharing/lib/SharedStorage.php 83.72% <0%> (-2.91%) 83% <0%> (ø)
lib/private/Files/Storage/Wrapper/Encryption.php 64.86% <0%> (-2.79%) 156% <0%> (+1%)
...e/AppFramework/DependencyInjection/DIContainer.php 72.34% <0%> (-0.71%) 81% <0%> (ø)
lib/private/legacy/json.php 9.52% <0%> (-0.65%) 27% <0%> (+2%)
...AppFramework/Utility/ControllerMethodReflector.php 100% <0%> (ø) 10% <0%> (ø) ⬇️
apps/dav/lib/CalDAV/CalDavBackend.php 80.24% <0%> (+0.08%) 176% <0%> (+1%) ⬆️
... and 7 more

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 420fd3d...18b20de. Read the comment docs.

@PVince81
Copy link
Contributor Author

Ok so I found a way to make invokePrivate work for both static and non-static methods!

$file = current($files);
if ($file instanceof Folder) {
// set the full path to enter the folder
$params['dir'] = $baseFolder->getRelativePath($file->getPath());
Copy link
Member

Choose a reason for hiding this comment

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

Can throw NotFoundException? Add a general purpose try catch?

Copy link
Member

Choose a reason for hiding this comment

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

Ok - never gets there ...

@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants