tus-android-client icon indicating copy to clipboard operation
tus-android-client copied to clipboard

The example should compare uploadChunk() against -1

Open peter-kehl opened this issue 4 years ago • 1 comments

https://github.com/tus/tus-android-client/blob/master/example/src/main/java/io/tus/android/example/MainActivity.java#L166 loops while(!isCancelled() && uploader.uploadChunk() > 0). However, according to https://github.com/tus/tus-java-client/blob/master/src/main/java/io/tus/java/client/TusUploader.java#L18 and https://github.com/tus/tus-java-client/blob/master/src/main/java/io/tus/java/client/TusUploader.java#L182, uploadChunk() may return 0 while the upload is not finished yet (for example, while the connection is down?).

Please fix the example to loop while(!isCancelled() && uploader.uploadChunk() > 1) instead.

peter-kehl avatar Feb 05 '20 22:02 peter-kehl

Thanks for bringing this to our attention! Would it be possible for you to open a PR for this?

Acconut avatar Feb 06 '20 16:02 Acconut