Skip to content

refactor(databases): stream /files upload via SDK upload_stream#142

Merged
zfarrell merged 4 commits into
mainfrom
feat/files-upload-stream
Jun 5, 2026
Merged

refactor(databases): stream /files upload via SDK upload_stream#142
zfarrell merged 4 commits into
mainfrom
feat/files-upload-stream

Conversation

@zfarrell
Copy link
Copy Markdown
Contributor

@zfarrell zfarrell commented Jun 5, 2026

Migrates the streaming /files upload off the raw-HTTP helper onto the SDK's upload_stream (now with content_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.

claude[bot]
claude Bot previously approved these changes Jun 5, 2026
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sentry
Copy link
Copy Markdown

sentry Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 91.96429% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/sdk.rs 95.37% 5 Missing ⚠️
src/databases.rs 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zfarrell zfarrell merged commit d0b249e into main Jun 5, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate /files upload to SDK upload_stream (needs Content-Length support first)

1 participant