refactor(databases): stream /files upload via SDK upload_stream#142
Conversation
There was a problem hiding this comment.
Clean migration. The blocking→async bridge handles back-pressure, receiver-drop, and read errors correctly, and with Content-Length set a mid-stream error aborts rather than truncating (no data-integrity risk). Auth/scope headers ride along via the cloned Configuration, and the no-timeout client is preserved on the SDK seam. Tests cover sized, chunked, and error-status paths, with the 5 MiB payload exercising channel back-pressure. The old raw-HTTP upload client and current_bearer are fully removed with no orphan references.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Clean migration off the raw-HTTP upload helper onto the SDK's upload_stream. The blocking→async bridge is correct (bounded back-pressure, receiver-drop and read-error paths both terminate cleanly), the no-timeout client preserves auth/scope headers via the cloned Configuration, error mapping reuses ApiError::from_sdk, and the removed helpers leave nothing orphaned. Tests cover sized, chunked, and error-status paths with a payload that exercises chunk-spanning and channel back-pressure.
Migrates the streaming
/filesupload off the raw-HTTP helper onto the SDK'supload_stream(now withcontent_length, via hotdata-dev/sdk-rust#35), bridging the progress-wrapped blocking reader into an async byte stream on a dedicated no-timeout client. Closes #133.