Skip to content

fix(notion): normalize malformed success responses (#2340 to stage) - #2359

Merged
asclearuc merged 1 commit into
stagefrom
fix/stage-RR-2336-notion-json-response
Sep 18, 2026
Merged

asclearuc merged 1 commit into
stagefrom
fix/stage-RR-2336-notion-json-response

Conversation

@krishhgg

@krishhgg krishhgg commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Type

fix

Testing

  • Tests added or updated
  • Tested locally: 70 passed in nodes/test/tool_notion
  • Ruff check and format check pass
  • ./builder test passes — not run; focused node tests were used

Checklist

  • Commit messages follow conventional commits
  • No secrets or credentials included
  • Wiki updated (if applicable) — node README updated
  • Breaking changes documented (if applicable) — no breaking changes

Paired Pull Requests

Linked Issue

Fixes #2336

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • develop
  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9a7fc4ce-23f2-420f-8799-7e658ae096da

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@github-actions github-actions Bot added docs Documentation module:nodes Python pipeline nodes labels Sep 18, 2026

@asclearuc asclearuc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @kgarg2468 — correct fix. resp.json() raising on a non-empty success body used to escape notion_client.request as a bare JSONDecodeError, which is neither the node's error envelope nor anything an agent can act on; converting it to NotionAPIError puts it back inside the contract. Catching ValueError is the right width, since requests.exceptions.JSONDecodeError and simplejson's both subclass it. Raising rather than continue keeps it out of the retry loop, which is the safe choice given the three write functions have no idempotency key. The message is built only from a fixed string and resp.status_code, so no response body can leak through it, and the two tests cover both the client layer and the public envelope.

This is the byte-identical port of #2340 onto stage (I compared the two diffs; they match exactly), so the review below is the same one I left on #2340.

Approve

No inline comments. The README note about a write whose response could not be decoded possibly having succeeded anyway is the right thing to have written down.

@asclearuc
asclearuc merged commit ffb6daa into stage Sep 18, 2026
23 of 24 checks passed
@asclearuc
asclearuc deleted the fix/stage-RR-2336-notion-json-response branch September 18, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation module:nodes Python pipeline nodes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants