Hi and thanks a lot for this great module!
Context:
The default timeout in dropzone is 30.000 ms (see http://www.dropzonejs.com/#config-timeout) which means 30 seconds. This is much too short for large files or slow internet connections. And especially for such large files dropzonejs is very interesting to indicate the progress.
Dropzone Version: 5.4.0
Problem:
- Large files can not be uploaded or people with a slow internet connection can not even upload smaller files
- The upload gets stuck with no error message. The progress bar just stops and nothing happens. No JS error, nothing. The POST is just aborted.
Proposed solution:
a) Make the timeout configurable via a setting
b) Might be enough (and is quick): Override the dropzone default with a higher value like 300 seconds and make it alterable via hook for more special cases
BONUS: Display an error message if the timeout is reached.
I'll attach a patch for (b) firstofall to fix the major problem. Of course we can then discuss to implement (a) additionally.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | dropzonejs-upload-timeout--2977463-21.patch | 1.85 KB | jcnventura |
| #17 | dropzonejs-upload-timeout--2977463-17.patch | 1.73 KB | jungle |
Comments
Comment #2
anybody8.x-1.x version patch attached.
8.x-2.x version patch will follow (if it's not identical)
Comment #3
anybodyComment #4
anybody8.x-2.x version patch attached.
Comment #7
anybodyComment #8
anybodyWell the failing tests seem unrelated?! I guess the test file upload doesn't work here? Can the maintainer explain what's wrong perhaps?
We've tested both patches manually with success.
Comment #9
anybodyComment #10
esolitosHi, I have updated the patch so it's a configurable value in milliseconds:
upload_timeout_ms, right now there's no form so it needs to be set manually, which is the same as the current other existing configtmp_upload_scheme.Comment #11
esolitosChange of priority because the default behaviour it causes silent failures on client side with no logging possible and there's no workaround.
Comment #13
esolitosErrors on tests seems unrelated.
Comment #15
primsi commentedComment #16
szeidler commentedI can confirm, that patch #10 is working fine. It is quite major bug, when considering having authors, that have a slow connection (e.g. mobile) and a rather large file size. The default 30 seconds from the library are unreasonable small.
The test failure seems to be unrelated to this patch.
Comment #17
junglehow about setting the default timeout to
0? Which should mean no timeout but haven't found from its documentation.Comment #18
keboca commentedFYI guys I applied the patch #17 and it solved my problems! it works as expected! thx!
Comment #19
anybodyAlso confirming RTBC of #17, thank you! Any active maintainer ready for the final review and commit?
Comment #20
wturrell commentedThank you for the patch. Also works nicely for me (core 8.8.4, dropzonejs 8.x-2.0 and dropzone 5.7.0)
(If anyone has done any theming work to make it look a bit nicer / cleaner / more Bartik compatible, I'd be interested…)
Comment #21
jcnventuraReroll of #17 for dropzone 8.x-2.1
No interdiff as I couldn't generate one, but I've only changed the dropzonejs_update_8003() function to follow the same code pattern as 8001 and 8002.
Comment #22
jungleThank you @jcnventura for working on this.
\Drupal usage should be avoided, use IoC injection instead.
Comment #23
jcnventura@jungle I only re-rolled your patch, as it was blocking our deployments.
This particular DropzoneJs.php file has 5 other invocations of \Drupal. One of them for the exact same config.factory service. The dependecy injection should be solved in a separate issue. If that issue exists, maybe this one can be marked as blocked by it.
Otherwise, I don't think this issue is the place to solve the lack of proper DI code in this module.
Comment #24
jungleAgree with you that to do it in a separate issue, thanks for your reply,
Comment #25
anybodyRe-confirming RTBC for #21! Thank you!
Hopefully we'll see this in the next release :)
Comment #27
jungleCommitted, thanks everyone for working on this!