-
Notifications
You must be signed in to change notification settings - Fork 173
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
Fix chunk uploads #993
base: master
Are you sure you want to change the base?
Fix chunk uploads #993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rely on the error type instead of the error message?
val chunksUploaded = current["chunksUploaded"] as Long | ||
offset = chunksUploaded * CHUNK_SIZE | ||
} catch (e: Exception) { | ||
if (e.message != null && !e.message!!.contains("file could not be found")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Steven, this seems fragile...
offset = chunksUploaded * CHUNK_SIZE | ||
} catch (e: Exception) { | ||
if (e.message != null && !e.message!!.contains("file could not be found")) { | ||
throw e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't call()
methods already throw these exceptions, is there any need to catch and throw here?
@@ -304,13 +308,13 @@ module {{ spec.title | caseUcfirst }} | |||
when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&') | |||
when Array then value.map { |v| encode(v, "#{key}[]") }.join('&') | |||
when nil then '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but can we fix the spacing here? Looks weird
params = emptyMap(), | ||
responseType = Map::class.java, | ||
) | ||
val chunksUploaded = current["chunksUploaded"] as Long |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Long
type the best choice?
What does this PR do?
Fix chunk uploads with predefined ID for
Test Plan
Running these code snippets.
Kotlin
Ruby
aaa.mp4
is bigger than 10MB.Related PRs and Issues
#963
Have you read the [Contributing Guidelines on issues]
Yes