Skip to content

fix(notion-app): follow block children pagination (#13915) - #14079

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
t3ratech:fix/notion-pagination-13915
Sep 15, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
t3ratech:fix/notion-pagination-13915

Conversation

@t3ratech

@t3ratech t3ratech commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #13915

Summary

get_page read only the first 50 block children and never followed has_more/next_cursor — long pages silently dropped content.

  • fetch_page_blocks follows start_cursor while has_more (page_size=100, Notion's max), caps at 10 pages, stops on missing/repeated/non-string cursor, surfaces later-page errors through the existing fail-closed path
  • Constants BLOCK_CHILDREN_PAGE_SIZE/MAX_PAGES/PAGE_CONTENT_LIMIT; shared helpers untouched
  • New hermetic test_pagination.py (9 tests) + notion-pagination-tests manifest check

Verification

  • 9/9 new tests OK; existing test_main.py 19/19 OK
  • Unpatched: all 9 fail
  • run_checks.py --check-id notion-pagination-tests → PASS

Review in cubic

tool_get_page read a page's blocks with a single children request and
ignored has_more/next_cursor, so anything past the first page was
silently dropped. fetch_page_blocks now follows the cursor at Notion's
100-block page size until the page is exhausted or the rendered text
reaches the 1,000-character output cap — the cap is the only thing that
truncates. A later-page failure returns that page's error so the
existing fail-closed path reports it; a page ceiling and repeated-cursor
detection bound a malformed cursor.

Verified: python3 plugins/omi-notion-app/test_pagination.py (9 tests,
fail on unpatched upstream/main) and test_main.py (19 tests) pass;
.github/scripts/run_checks.py --lane local --check-id
notion-pagination-tests passes.

Failure-Class: none
@t3ratech

t3ratech commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

/claim #13915 PayPal: [email removed]

@kodjima33 kodjima33 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.

Well-scoped bug fix: get_page now follows Notion's has_more/next_cursor block-children pagination instead of truncating at 50, with bounds against malformed cursors. Clear root cause, linked issue, 9 hermetic tests, CI clean. Confidence 5/5 — merging.

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.

[Bounty proposal] fix(notion-app): get_page reads only the first 50 blocks and never follows next_cursor

2 participants