-
Notifications
You must be signed in to change notification settings - Fork 8
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
TUS upload support (WIP) #65
Comments
1. core protocol
2.
|
Okay. Same as previous chunking implementations. |
post with metadata currently uses metadata to send the checksum: https://github.com/cs3org/reva/pull/674/files#diff-5fec0456a6ea9fb1227335fc8d3f8cfdR150 |
TUS support development has moved to |
The SDK should provide support for uploading files via the TUS protocol.
Notable observations from reading the spec:
1. Background NSURLSession friendly
If the server does store as much of the received data as possible, the SDK has an easier time to comply with requirements for
NSURLSession
background queues and avoiding penalties:HEAD
request to retrieve the offset to resume fromNSURLSession
with long delays - can be mostly avoided2. Schedulable
It would be preferable if clients were able to directly start an upload with a single request:
NSURLSession
as a single request if Creation With Upload extension is implementedNSURLSession
with long delays3. Defined expiration
This helps in determining whether an upload should be continued or not - and resume only uploads that are known to still be around. On the other hand, a
HEAD
request would be required anyway before resuming an upload, at which point an expired upload should also become apparent.If the expiration date should be supported and utilized, though, adding support for expiration directly to the OCHTTP system should be considered, with requests being terminated with a new error code in case they have expired before having been scheduled.
4. Checksum troubles
The Checksum extension needs checksums to be provided on a per-request basis, calculated not over the entire file but over the body of the respective upload requests.
This is generally fine, but does not cover the scenario where an upload is interrupted and the server should use the already received bytes:
Possible solutions:
1. Store checksums, check when upload is complete
The specification provides this hint:
The solution therefore could be to store all checksums and only verify them against the respective parts once they have been received in full.
Drawback:
2. Custom header with the full file checksum
A custom header with the full file checksum (f.ex.
OC-Full-Upload-Checksum
) is passed to the Create With Upload extension when the upload is initiated. That would allow verification of the full file once the upload has completed.Drawback:
3. Custom header with the checksum over already transferred data
An additional, custom header with the checksum of the file up to the point the upload resumes from (f.ex.
OC-Transmitted-Upload-Checksum
) would allow the server to check if the data received before is consistent - and allow the server to cancel an already.Drawback:
Drawback mitigation:
HEAD
requests, for which the client should provide a checksum when resuming the upload – allowing the server to accept partial requests while ensuring consistencyPragmatic and performant
A pragmatic and performance-oriented approach would likely by a combination of 1. and 3.
Related issues
Known issues
The current implementation in
develop
has the following known issues:The text was updated successfully, but these errors were encountered: