Repository navigation
Read nested Notion blocks in page order - #1085
Conversation
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Thanks @Floating-Y. Text inside toggles and columns was simply not read, so this is a correctness fix and it lands. The traversal order, the shared block budget and stopping at child pages and databases are right.
One cost to know about, not to change here: every block with children is now one more paced request, and the sync reads every page's body on every run, whether or not the page changed. A workspace of pages with thirty toggles each goes from about three minutes a sync to well over an hour. The cure is not in the traversal: the search result already carries last_edited_time, so a page whose time matches the stored document's need not have its blocks read at all. That would make syncs cheaper than they were before this PR. If you want it, it is yours; otherwise I will open an issue for it.
Why
Notion's children endpoint returns one level at a time. The connector only read top-level blocks, omitting paragraphs inside toggles and columns. This fixes a traversal gap in the original connector, not a regression from the rate-limit fix in #269.
What changes
Pacedclient and oneMAX_BLOCKS_PER_PAGEbudget across the entire page, retaining request spacing, 429 retries, and Retry-After handling. Stop making requests when the budget is exhausted.child_pageandchild_databaseboundaries.How it was checked
Unchangedon the next identical sync.cargo fmt --all --checkandcargo clippy --locked --workspace --all-targets -- -D warningspassed.--test-threads=1passed with database and PDF checks required. The existing real-workspace smoke test was filtered out of that run; the dedicated live test above was run separately.Before review
git commit -s).cargo fmt --all --checkpassed.cargo clippy --locked --workspace --all-targets -- -D warningspassed.