Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #341 +/- ##
==========================================
+ Coverage 75.37% 75.90% +0.53%
==========================================
Files 148 152 +4
Lines 5908 6201 +293
==========================================
+ Hits 4453 4707 +254
- Misses 1455 1494 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Is it possible to cancel an upload ? |
for uploadFromFile yes, you can just cancel the returned stream |
|
nogringo
left a comment
There was a problem hiding this comment.
Currently, the file is read twice. We can optimize it to read it once if the server does not require auth.
UploadFromFile flow
verifyHash = false
- Send bytes to the server
- If server requires auth:
- Calculate hash locally
- Create the auth event
- Resend bytes
- If server requires auth:
- Server sends the blob descriptor
verifyHash = true
- Start reading file (bytes are used for both hash + upload in parallel)
- If server asks for auth:
- Continue calculating hash, stop uploading
- Once hash is calculated, create the auth event
- Resend bytes to the server
- If server asks for auth:
- Both hash and blob descriptor are done
- Verify blob descriptor hash matches local hash
|
I got this Idea for optimizing the flow in some cases but IMO it add too much complexity so the idea is here but we don't need to implement it. |
|
The implementation that we need is BUD-06 |
|
Currently, the progress only reflects the upload phase. Hash calculation and mirroring phases have no progress reporting. Report progress for each phase separately: class BlobUploadProgress {
final UploadPhase phase; // hashing | uploading | mirroring
final double progress; // 0.0 - 1.0 for current phase
// For mirroring phase
final int mirrorsTotal;
final int mirrorsCompleted;
} Example flow This lets developers show accurate progress for each phase instead of the current behavior where progress stays at 0% during hashing. |
|
Start reading file (bytes are used for both hash + upload in parallel)
The described verifyHash = true flow won't work in parallel because we need the hash before uploading, and reading the file once would require storing it in memory. |
nogringo
left a comment
There was a problem hiding this comment.
BlobUploadProgress and UploadPhase are not exported from the public API.
fixes: #211
dependent on: #332 (merge before)
This PR introduces file streaming so large files are not loaded entirely into memory.
Its non-breaking, old method signatures have not been altered.
Both the files usecase and blossom usecase have the new streaming methods.