splitbee / notion-api-worker

Notion as CMS with easy API access
MIT License
1.56k stars 197 forks source link

Many blocks are missing from page response #41

Closed dvdsgl closed 3 years ago

dvdsgl commented 3 years ago

After a recent update, many blocks are no longer returned for our pages. One page dropped 50-100 blocks from the end of the page.

In page bc7f910ef23b421487ca21b959c67c49, block 771f85de-f188-46e6-90d6-9b2dd814ba10 is listed in the content of the page, but the block content is not actually included.

We noticed that by deleting early blocks on the actual Notion page, missing blocks can be fetched by the API — in other words, blocks at the end of the page are more likely to be missing.

transitive-bullshit commented 3 years ago

Hmmm, comparing https://www.notion.so/Copy-of-2020-Q4-bc7f910ef23b421487ca21b959c67c49 with https://react-notion-x-demo.transitivebullsh.it/bc7f910ef23b421487ca21b959c67c49, I'm not able to see any difference for the part of the document in question.

Have you tried using https://github.com/NotionX/react-notion-x?

See attached screenshot.

Screen Shot 2021-03-07 at 10 38 59 AM
transitive-bullshit commented 3 years ago

This probably has to do with notion-api-worker not fetching as many async blocks as notion-client does https://github.com/NotionX/react-notion-x/blob/master/packages/notion-client/src/notion-api.ts#L71

In particular, I think getPageContentBlockIds is more complex than the version currently in notion-api-worker.

dvdsgl commented 3 years ago

Wow! NotionX looks awesome! Trying now 👍

dvdsgl commented 3 years ago

I confirmed that notion-client is fetching all of the blocks.

JhumanJ commented 3 years ago

Hello, any update on this?

tobiaslins commented 3 years ago

Hey @JhumanJ + @dvdsgl

We just merged this now, thanks @JhumanJ !