fix: Skip fetching children for unsupported Notion blocks (#9289)

* fix: Skip fetching children for unsupported Notion blocks

* better naming
This commit is contained in:
Hemachandar
2025-05-24 02:47:05 +05:30
committed by GitHub
parent 0170b98974
commit 82b5b87440

View File

@@ -57,6 +57,11 @@ export class NotionClient {
private client: Client;
private limiter: ReturnType<typeof RateLimit>;
private pageSize = 25;
private skipChildrenForBlock = [
"unsupported",
"child_page",
"child_database",
];
constructor(
accessToken: string,
@@ -178,8 +183,7 @@ export class NotionClient {
blocks.map(async (block) => {
if (
block.has_children &&
block.type !== "child_page" &&
block.type !== "child_database"
!this.skipChildrenForBlock.includes(block.type)
) {
block.children = await this.fetchBlockChildren(block.id);
}