Comments (8)
Meanwhile I've looked at the code and added this around line 1140-1154 to test the behaviour and it seems to solve the issue. Now if I receive a 409 (conflict) flow stops the upload process and marks it as an error.
this.testHandler = function(event) {
var status = $.status();
if (status === 'success') {
$.tested = true;
$.fileObj.chunkEvent(status, $.message());
$.flowObj.uploadNextChunk();
} else if (status === 'error') {
console.log("Irrecoverable error");
$.fileObj.chunkEvent(status, $.message());
} else if (!$.fileObj.paused) {// Error might be caused by file pause method
$.tested = true;
$.send();
}
};
(I've closed the issue by mistake)
from flow.js.
File testing does not support permanent error handling at the moment and this should be implemented.
Your code causes to fail one test case (File testing feature is not working anymore). If you could fix this, please make a pull request.
Line which is causing problems:
https://github.com/flowjs/flow.js/blob/master/src/flow.js#L1309
maxChunkRetries
by default is set to 0 and this statement is always true then file is being tested.
from flow.js.
Thanks for the reply @AidasK . I'll give it a stab this weekend.
from flow.js.
Should be fixed with c2080ef
Please test it, will be released once tested in a production.
from flow.js.
Would be nice to also update the documentation/README to describe how this can be done. Thanks!
from flow.js.
Do you/we want to abort on any errors?
For example 503 Service Unavailable
is a transient server error and for this kind of error we would like to flow.js client to retry the test.
From this point of view, it would be nice if flow.js would allow configuring a list of error codes which has the semantic of "reject".
I would say that we would need a list of rejectErrorCode = [409] and stop testing only if this specific error code is returned... for all other errors, retry.
Thanks!
from flow.js.
We have such an option, it is called permanentErrors
https://github.com/flowjs/flow.js#configuration.
Unfortunately, request retry works only for upload requests. How file testing works:
- We send GET(by default) request to the server with chunk params
- Server checks and validates the file:
- if file is invalid, server returns error code, which is in
permanentErrors
list, file upload stops. - if file is valid and file chunk exists on the server side, server returns status from
successStatuses
list. Client moves to the next chunk test/upload. - if file is valid and file chunk does not exists on the server side, server returns any status, which is not in the
permanentErrors
andsuccessStatuses
lists. Client uploads the chunk.
In order to support retry feature for file testing, we need a separate status list, such as chunkNotFoundStatuses
. If response status is not in this array, then retry.
from flow.js.
Many thanks! I think that copying your comment in the documentation would be a great improvement to the documentation :)
from flow.js.
Related Issues (20)
- Question: Is it possible to avoid long relative paths ? HOT 1
- v3 does not support pausing/resuming from stream HOT 4
- Bundle contains calls to Function() which are "unsafe-eval" (CSP) HOT 2
- v3 release HOT 8
- Subtypes not unifying through generic parameter
- Can we have shorter syntax for?
- Multiple uploads only include query data inside first upload.
- Can't upload empty file when using asyncReadFileFn hook [v3 regression] HOT 7
- Upload to azure blob crash on large files
- Typecasting Object assignment within Array.forEach
- flowTotalSize is 0 when uploading folder with longer path
- No option to allow user to select either a file *or* a folder?
- Getter/Setter, inheritance and $ReadOnly interacting incorrectly HOT 1
- Complete running before fileSuccess
- "new" operator HOT 2
- Strange "unconstrained" behavior with React components HOT 2
- Client and Server only works on same host.
- [Feature Request] Dart Package as Client Library for Flutter Apps
- Unable to import Flow without adding @types/flowjs__flow.js devdependency HOT 2
- Issue while retrying uploads HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flow.js.