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

【Block上限】修复部分文章无法加载的问题 #1723

Merged
merged 6 commits into from Jan 30, 2024

Conversation

Olimiya
Copy link
Contributor

@Olimiya Olimiya commented Dec 21, 2023

修复这个issue中的问题。

fix: 修复部分文章无法加载的问题,原因是Notion API加载时block上限1000

修复思路是在加载所有文章时,会首先一次性加载数据库中所有block,此时因为上限1000会发生溢出。之后会读取所有page的IDs,然后逐个获取page对应的block。此时如果发现ID查找不到(说明发生了溢出),则再调用API去逐一获取这些溢出了的page。可能这不是最优解。
修改的代码包括:

  1. getDataBaseInfoByNotionAPI中添加上述判断逻辑。
  2. 修改getPageProperties函数签名,直接传入block对应的value,而不是block数组。

修复思路是在加载所有文章时,会首先一次性加载数据库中所有block,此时因为上限1000会发生溢出。之后会读取所有page的IDs,然后逐个获取page对应的block。此时如果发现ID查找不到(说明发生了溢出),则再调用API去逐一获取这些溢出了的page。可能这不是最优解。
修改的代码包括:
1. getDataBaseInfoByNotionAPI中添加上述判断逻辑。
2. 修改getPageProperties函数签名,直接传入block对应的value,而不是block数组。
@yuanyuanyuan
Copy link

请问这个 bug 什么时候可以 fix?

修复思路是在加载所有文章时,会首先一次性加载数据库中所有block,此时因为上限1000会发生溢出。之后会读取所有page的IDs,然后逐个获取page对应的block。此时如果发现ID查找不到(说明发生了溢出),则再调用API去逐一获取这些溢出了的page。可能这不是最优解。
修改的代码包括:
1. getDataBaseInfoByNotionAPI中添加上述判断逻辑。
2. 修改getPageProperties函数签名,直接传入block对应的value,而不是block数组。
@tangly1024 tangly1024 merged commit 0478320 into tangly1024:main Jan 30, 2024
2 of 3 checks passed
@tangly1024 tangly1024 changed the title 修复部分文章无法加载的问题 【Block上限】修复部分文章无法加载的问题 Mar 19, 2024
happyzhangyyds pushed a commit to happyzhangyyds/NotionNext that referenced this pull request Apr 30, 2024
修复部分文章无法加载的问题
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.

None yet

3 participants