Skip to content
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

TusUpload should have mandatory fields. #34

Closed
klawyMarcin opened this issue Jun 15, 2020 · 2 comments
Closed

TusUpload should have mandatory fields. #34

klawyMarcin opened this issue Jun 15, 2020 · 2 comments

Comments

@klawyMarcin
Copy link

Field "size" in TusUpload should be mandatory when using streams. I didn't provide it and upload worked BUT on receiver side there was a problem with object UploadInfo (method uploadInfo.isUploadInProgress() in particular). Despite upload being finished isUploadInProgress showed "true". Moreover on client side field is named size, and on server side it's called length. It's a bit misleading.

As a solution I propose to remove no arguments constructor and replace it with constructor, that accepts all required parameters. Or to use builder that throws exceptions if not all mandatory field combinations are provided.

@Acconut
Copy link
Member

Acconut commented Jun 19, 2020

Thank you for the feedback and the recommendations! Frankly, I have never thought about that.

As a solution I propose to remove no arguments constructor and replace it with constructor, that accepts all required parameters.

That's a good idea! Would you be willing to open a PR for this?

@Acconut Acconut mentioned this issue Jan 17, 2023
5 tasks
@Acconut
Copy link
Member

Acconut commented Jan 17, 2023

We will address this in the next major release: #78

@Acconut Acconut closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants