Skip to content

[NOTE-1714] feat: accept 207 Multi-Status responses - #550

Merged
agtang96 merged 3 commits into
mainfrom
fix/treat-207-as-success
Oct 25, 2026
Merged

agtang96 merged 3 commits into
mainfrom
fix/treat-207-as-success

Conversation

@agtang96

@agtang96 agtang96 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

HTTP_SUCCESS_CODES is [200, 201, 202, 302], so any 207 Multi-Status response raises a NylasApiError. This PR adds 207 to that list.

Why now: the Notetaker media endpoint will return 207 when a requested artifact failed but the rest is available, for example when the summary failed but the recording and transcript are fine. The body carries the available media plus an errors list. That behaviour is not live yet; it turns on with an upcoming Notetaker release. Without this change, Notetakers#download_media would raise on those responses and callers would lose the media that is available. The Node, Python and Java SDKs already accept any 2xx status.

Changes:

  • lib/nylas/errors.rb: add 207 to HTTP_SUCCESS_CODES.
  • Specs: a 207 doesn't raise in handle_failed_response, and parse_json_evaluate_error returns the parsed 207 body. Both new specs fail without the change.
  • CHANGELOG.md: an Unreleased entry.

Testing (Ruby 3.2 in Docker):

  • bundle exec rspec: 320 examples, 0 failures.
  • bundle exec rubocop on the changed Ruby files: no offenses.

CI: Ruby 3, Ruby 3.2 and CodeQL pass. Ruby 3.1, Rubocop and docs fail before running anything, and they would fail on any PR right now:

  • Ruby 3.1 and Rubocop: setup-ruby has no Ruby 3.1.7 or 3.0.0 build for the ubuntu-26.04 runner.
  • docs: cloudflare/pages-action can no longer be resolved.

License

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.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CEuUhrasuRFEFW6KcTW7QN

The Notetaker media endpoint returns 207 when some requested media
(for example the summary) failed but the rest is available. The body
carries the available media plus an `errors` list. HTTP_SUCCESS_CODES
did not include 207, so download_media raised a NylasApiError and the
caller lost the working recording URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CEuUhrasuRFEFW6KcTW7QN
@agtang96 agtang96 changed the title [NOTE-1714] fix: treat 207 Multi-Status responses as success [NOTE-1714] feat: accept 207 Multi-Status responses Oct 25, 2026

@qasim-nylas qasim-nylas left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 👍

@agtang96
agtang96 merged commit 5029374 into main Oct 25, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
sdk-reference — 20d4bc6b Deployed Oct 25, 2026 by agtang96 via docs #335
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.

2 participants