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: unable to render synced_block from both ways #89

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

Doradx
Copy link
Contributor

@Doradx Doradx commented Jun 5, 2023

fix the bug when querying children blocks for synced_block.

fix the bug when querying children blocks for synced_block.
@souvikinator
Copy link
Owner

Can you elaborate on the bug you encountered?

@Doradx
Copy link
Contributor Author

Doradx commented Jun 5, 2023

When I use the original code, it can't get the child block of synced_block.
Because the child block can't be queried with the ID of the parent block, what I found when I debug with notion API, it should be queried with synced_block.synced_from.block_id.

@souvikinator
Copy link
Owner

So the content of the synced_block is not getting rendered right? If that is the case then, it works fine on my end:

This is the parent page with a synced block and the child page (Page-1) includes the same synced block.
image

output:
image

if this is not the issue then please provide steps to reproduce the bug.

@Doradx
Copy link
Contributor Author

Doradx commented Jun 5, 2023

It works fine for the referenced page (page A) but not for the slave page (page B) refers to page A.
For example, when you write something on page A, then copy and sync it to page B, the exported markdown files only work fine for page A, not page B.
You can find the reason in the response from notion API.
Here are the responses from the Notion API for Page A and Page B respectively:
Response from Notion, for page A
Response from Notion, for page B
the UUID of the block is d87824d6-b706-4a1e-b060-878b0c2909b5, and it appeared as the block id for page A, but as synced_block.synced_from.block_id for page B. And the output of sycned_block for page B will be empty if you query its content without using synced_block.synced_from.block_id.

@souvikinator
Copy link
Owner

Thanks for explaining. That makes it clear. I'll merge it and it should be live in the upcoming update. Thank you for your contribution.

@souvikinator souvikinator merged commit 605fe50 into souvikinator:master Jun 9, 2023
@souvikinator souvikinator changed the title add support for synced_block. Fix: unable to render synced_block from both ways Jun 9, 2023
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

2 participants