Skip to content

fix: honor request overrides for attachment downloads - #492

Draft
Kayvan-Zahiri wants to merge 1 commit into
nylas:mainfrom
Kayvan-Zahiri:codex/attachment-download-request-overrides
Draft

Kayvan-Zahiri wants to merge 1 commit into
nylas:mainfrom
Kayvan-Zahiri:codex/attachment-download-request-overrides

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

Fixes #491.

Attachment downloads pass the overrides dictionary as _build_request's positional request_body. As a result, download and download_bytes ignore custom API URLs, API keys, headers, and skip-auth options, and add JSON Content-type to a bodyless GET when overrides are nonempty. Timeout selection works, but timeout errors retain the wrong URL when API URI is overridden.

Pass overrides by keyword. Add14 cases through both public attachment-download methods using the real HTTP client and a mocked requests boundary: default behavior, URL/header/key/auth/timeout overrides, binary and streaming results, and timeout error metadata. On original main,12 fail and2 pass. Update one existing timeout-test expectation that pinned the erroneous JSON header. No API contract or dependency changes.

Validation: full unit suite505 passed,3 live-API tests deselected,1 existing TestData collection warning. Changed implementation/new-test Pylint error checks, new-test Black formatting, and git diff --check pass. No live Nylas calls were made. Developed with Codex assistance and verified locally.

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

This branch has not been deployed

No deployments
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.

Attachment downloads ignore request URL and header overrides

1 participant