Skip to content

Stop new Notion writes after cancellation and bound response reads - #49

Merged
DaveHomeAssist merged 1 commit into
claude/notion-adapter-v1from
codex/notion-cancellation-deadlines
Oct 1, 2026
Merged

DaveHomeAssist merged 1 commit into
claude/notion-adapter-v1from
codex/notion-cancellation-deadlines

Conversation

@DaveHomeAssist

@DaveHomeAssist DaveHomeAssist commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

An approved Notion append or block edit could still dispatch after its caller was cancelled during the preflight read. HTTPX inactivity timeouts also allowed a slow response body to exceed the adapter request budget.

This change propagates cancellation into the shielded operation and checks it before every new write, including a rate-limit retry. Readback remains possible for an already dispatched write. Each HTTP exchange now has an absolute deadline; an expired write is treated as uncertain.

Five regressions cover cancelled appends, cancelled edits, cancelled rate-limit retries, verification after dispatch, and slow response bodies.

Validation: 46 focused tests passed; strict mypy and generated capability checks passed; six approval-preview tests passed. CI passed the full suite, offline qualification, type checks, and remaining gates on Python 3.12, 3.13 and 3.14 (run 36865219563). The redundant local full-suite process was stopped after remote CI passed; local full-suite completion is not claimed.

Companion to #48, changing only the adapter and its regression tests. No live Notion adapter call has been verified because no dedicated server token is configured in this session.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T12:59:54.073555Z 3be1818 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3be1818d5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread davellm_notion.py
Comment on lines +616 to +618
cancelled = _WRITE_CANCELLED.get()
if method != "GET" and cancelled is not None and cancelled.is_set():
raise _Budget()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Abort writes still waiting inside the HTTP transport

When a PATCH passes this check and then waits inside HTTPX for a connection-pool slot or connection establishment before any bytes are sent, cancelling the caller only sets the event; the shielded _send remains alive and proceeds with the write once the transport unblocks. Thus a Notion mutation can still be dispatched after cancellation despite this change's guarantee. The in-progress transport operation must observe cancellation or be aborted and reconciled as uncertain.

Useful? React with 👍 / 👎.

@DaveHomeAssist
DaveHomeAssist merged commit 95d6ea7 into claude/notion-adapter-v1 Oct 1, 2026
3 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.

1 participant