Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken pending block fetching #52

Merged
merged 1 commit into from
Aug 2, 2021
Merged

Conversation

JhumanJ
Copy link

@JhumanJ JhumanJ commented Jul 20, 2021

This PR aims to address the issue raised in #51 and #41
When the page is longer than 100 blocks, it cannot be retrieved in a single call to the Notion private API. There was code to go through the "pagination" to retrieve missing blocks, but it was not working. I replaced it something simpler that does the following:

  • Get the list of all block ids on the page
  • Check which one are missing from the list of blocks we have
  • Fetch missing blocks
  • Do that again if there are still missing blocks.

Because my code is simpler, I may have broken other things. I don't have any knowledge about the Notion private API, so if you have more experience, please review the change made.

@timolins
Copy link
Member

timolins commented Aug 2, 2021

Looking good. Thanks for this!

@timolins timolins merged commit 882d36e into splitbee:master Aug 2, 2021
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.

2 participants