Skip to content

Conversation

@PVince81
Copy link
Contributor

@PVince81 PVince81 commented Jul 17, 2017

Resend of #26306.
See original post there.

Remaining bugs:

  • BUG: progress bar disappears during final MOVE

@PVince81 PVince81 added this to the development milestone Jul 17, 2017
@PVince81 PVince81 self-assigned this Jul 17, 2017
@PVince81
Copy link
Contributor Author

PVince81 commented Jul 17, 2017

  • TODO: fix JS unit tests

@PVince81 PVince81 force-pushed the wwebui-uploadchunking-resend branch from 4250deb to 4d0e49f Compare July 19, 2017 08:25
@PVince81
Copy link
Contributor Author

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.

@PVince81 PVince81 force-pushed the wwebui-uploadchunking-resend branch from 4d0e49f to 33a0084 Compare July 20, 2017 15:15
@PVince81 PVince81 requested a review from DeepDiver1975 July 20, 2017 15:23

// 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());
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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

@PVince81
Copy link
Contributor Author

PVince81 commented Jul 24, 2017

  • sort out passing the config value

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.

@PVince81 PVince81 force-pushed the wwebui-uploadchunking-resend branch from 33a0084 to 6f9fceb Compare July 31, 2017 13:29
@PVince81
Copy link
Contributor Author

@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.

@@ -1,4 +1,6 @@
<?php

use Symfony\Component\EventDispatcher\GenericEvent;
Copy link
Member

Choose a reason for hiding this comment

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

not in use

*
*/

use Symfony\Component\EventDispatcher\GenericEvent;
Copy link
Member

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(),
Copy link
Member

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?

Copy link
Contributor Author

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.

@PVince81 PVince81 force-pushed the wwebui-uploadchunking-resend branch from 6f9fceb to 5560c20 Compare August 1, 2017 07:45
@PVince81
Copy link
Contributor Author

PVince81 commented Aug 1, 2017

@jvillafanez removed unused imports. I also adjusted @since 9.2 to say @since 10.0.3

@PVince81
Copy link
Contributor Author

PVince81 commented Aug 1, 2017

restarted jenkins build

@PVince81
Copy link
Contributor Author

PVince81 commented Aug 1, 2017

stable10: #28547

@Emil-G
Copy link

Emil-G commented Nov 15, 2017

@PVince81 : why not implemented for anonymous uploads as well?

@PVince81
Copy link
Contributor Author

@Emil-G see #8955 (comment)

@Emil-G
Copy link

Emil-G commented Nov 15, 2017

@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,
Emil

@PVince81
Copy link
Contributor Author

No, because we will move away from public.php/webdav. We are standardizing on "remote.php/dav" for everything already.

@Emil-G
Copy link

Emil-G commented Nov 16, 2017

So chuncking will be done for non-auth users, by opening up "remote.php/dav" from the webinterface?

@PVince81
Copy link
Contributor Author

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

@lock
Copy link

lock bot commented Aug 1, 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 Aug 1, 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.

5 participants