Repository navigation
The Notion client waits out a rate limit instead of failing the sync - #269
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com>
This was referenced Sep 3, 2026
Merged
Contributor
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of #215. Thanks to @jeremycapps for running the connector against a real workspace.
Symptom
On a workspace with more than a hundred pages the sync ran for about three minutes and then died with
notion search 回了 429 Too Many Requests. The small-workspace run in the same report passed, so the connector itself works; it is the pace that breaks.Cause
Requests were sequential but not paced. Notion allows roughly three requests per second; a 100 ms response followed immediately by the next request is ten. And a 429 was treated like any other failure: the sync bailed instead of waiting out the
Retry-Afterheader Notion sends with it.Change
A small
Pacedclient wraps every Notion call innotion.rs:Retry-After(seconds, fractional allowed; 1 s if missing or unreadable; capped at 30 s) and retry, up to five times, then surface the errorThe extraction path's backoff is not reused on purpose: it is tuned for model providers and their error taxonomy. This one is local to the connector and about twenty lines.
Verification
cargo fmt,cargo clippy --all-targets -D warnings,cargo test -p utopia-server notion: clean, 7 passed (a unit test pins theRetry-Afterparsing: header value, fractional, missing, garbage, negative, capped)UTOPIA_NOTION_TEST_TOKEN=... cargo test -p utopia-server notiononce more on the large workspace after this lands, that would confirm both the pacing and pagination past 100.🤖 Generated with Claude Code