-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Enable chunking for bigger files in authenticated web upload #28415
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
Conversation
|
4250deb to
4d0e49f
Compare
|
I just realized that using the new chunking endpoint also means we can't detect errors early, so uploading to a folder that doesn't exist will only error at the very end during the final MOVE. I don't want to add an extra PROPFIND on the client just for that and would prefer a more streamlined solution. Raised here: #28452 I have fixed the progress bar, it now stays until the end of the final MOVE. |
4d0e49f to
33a0084
Compare
core/js/config.php
Outdated
|
|
||
| // Allow hooks to modify the output values | ||
| OC_Hook::emit('\OCP\Config', 'js', ['array' => &$array]); | ||
| $event = \OC::$server->getEventDispatcher()->dispatch('OCP\Config::js', new GenericEvent()); |
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 don't think this is a good approach:
- The overall approach seems weird. You usually don't send an event and expect the listeners to overwrite the arguments of the event. You send an event to let the listeners react to that event.
- Overwriting data inside a listener doesn't seem a good idea. I think this is a similar case of attaching something to a data stream in order to overwrite its data. While the files app will likely be always active, other apps that could overwrite values could be enabled and disabled at will. This might change the values unexpectedly for the users.
- Taking into account several listeners could modify the same key, there is no explicit information about what should be the expected value. If I create another app and modify the chunk size, what should be the expected chunk size value? It will depend on which is the last app that has overwrite the value, but that's not enough to know if it will be mine or yours.
The main problem I see is that fetching external information (from other apps for example) using events doesn't seem to be a good choice.
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 think for this PR I'd just go for the simplest approach and wherever place you'll use the max chunk size value, fetch whatever is in the configuration and overwrite it there.
For a more complex approach, in order to overwrite configuration values I'd include some methods in the Config object to register specific IConfigListener objects, whose interface would have a fetching($key, $value) method which should return the expected overwritten value for that config key.
There are 2 extra things we should take care of: how can we properly extend the current Config class with this functionality, and also the priority of the registered IConfigListener objects in order to pick the value we want in the case we have more than one object modifying the configuration.
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 think for this PR I'd just go for the simplest approach and wherever place you'll use the max chunk size value, fetch whatever is in the configuration and overwrite it there.
I need it in the JS code and this seemed like a good choice. I could also have used the old hook that does just that: overwrite the array values.
The other option is to embed the value of the config inside the DOM in the files app template, which I found less elegant.
When I asked @DeepDiver1975 about overwriting values in the symfony event he seemed to agree. We also used this approach in the config report app.
@jvillafanez your concern is legitimate, so I'd like us to have a common decision on whether to allow this or not and make it a guideline. @DeepDiver1975
Note: the reason I chose to have a config value is mostly because I'm pretty sure someone will want to change it and having it hard-coded would result in "integrity check" errors when changed. |
33a0084 to
6f9fceb
Compare
|
@jvillafanez adjusted. I'm now using the old hook for passing the value. Inventing a new better clean way to pass values to be done separately in the future. |
apps/files/appinfo/app.php
Outdated
| @@ -1,4 +1,6 @@ | |||
| <?php | |||
|
|
|||
| use Symfony\Component\EventDispatcher\GenericEvent; | |||
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.
not in use
core/js/config.php
Outdated
| * | ||
| */ | ||
|
|
||
| use Symfony\Component\EventDispatcher\GenericEvent; |
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.
not in use
|
|
||
| var client = new OC.Files.Client({ | ||
| host: OC.getHost(), | ||
| port: OC.getPort(), |
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.
do we want to remove this, or add the option in the client?
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 removed it because it's unused by OC.Files.Client. getHost() already contains the port.
6f9fceb to
5560c20
Compare
|
@jvillafanez removed unused imports. I also adjusted |
|
restarted jenkins build |
|
stable10: #28547 |
|
@PVince81 : why not implemented for anonymous uploads as well? |
|
@PVince81 - Thanks for that. It seems that there now are a lot of different endpoints, would it not be beneficial to standardize? We are currently having some issues with OC Enterprise, where anonymous users struggle with large file uploads, if chunking was used in the same way as web, we would not have any issues as auth users works flawless. As we cannot allow users "guest management", and we can't do guest management from an administrative perspective, the Guest addon cannot be used in our scenario. Are you sure that this endpoint cannot have chunking in the very near future? Cheers, |
|
No, because we will move away from public.php/webdav. We are standardizing on "remote.php/dav" for everything already. |
|
So chuncking will be done for non-auth users, by opening up "remote.php/dav" from the webinterface? |
|
No, this is a technical detail. The public link page will stop using public.php/webdav and will use "remote.php/dav/public-files" for any file access. This will make it possible to use "remote.php/dav/uploads" which web UI chunking already uses in the future and instead of putting the assembled file to "remote.php/dav/files" it will put it to "remote.php/dav/public-files". Currently "public-files" is not ready: #29369 @Emil-G as you are having issues with the enterprise edition, please go through the support channels |
|
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. |
Resend of #26306.
See original post there.
Remaining bugs: