Send big files in pieces, so a dropped connection doesn't start them again #144
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 374 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.355
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #144"
general
weight: 0.35
ethanteng
Why
Uploading an 835 MB Evernote export kept going back to zero. Each file went up as one long request. Over the Funnel tunnel, a connection drop came before the end almost every time, and each drop started the whole file again. I couldn't find what causes the drops (nothing documented about Funnel limits long requests), so this makes a drop cheap instead.
What changed
Server
PUT /api/uploads/{id}now also takesoffsetandsize. With them, the body is one piece of a filesizebytes long, starting atoffset..parts/<sha256(path, size, modified)>.pieceand moved into place once the last byte is in. Finishing an upload never picks up half a file.offset, cutting anything an earlier try left past that point. If the file holds less thanoffset, the piece is refused with a 409.GET /api/uploads/{id}/piece?path=&size=&modified=says how much of a file has arrived. If the file is already whole and only the answer to its last piece was lost, it answers the full size.partly: [{ path, bytes }]. A page closed partway therefore carries on from where it stopped. A file that has changed since has a different piece name and starts again.offset) behave exactly as before. The iOS client is unaffected.Page
docs/technical.mdis updated.Testing
- a piece cut off and sent again
- a last piece whose answer was lost
- pieces that don't follow on or run past the end
- picking up after the page went away, including a changed file starting again
- an earlier try still waiting on its connection giving way
- the page carrying on from what Uncloud kept
- A 100 MB file dropped onto My files in the browser, with the second piece's connection cut, arrived byte for byte (SHA-256 matched).
- With curl, a piece was cut off about 9 MB in. Uncloud kept that much. Adding the file again reported it under
partly. Sending the rest finished the file, and its SHA-256 matched the original.For reviewers
🤖 Generated with Claude Code