Conversation
Owner
Author
|
👋 Hi, Myastr0! Thanks for opening a PR. We will review it soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
New Feature Submissions:
Changes to Core Features:
Description
This PR fixes a bug in the
--flatdatabase synchronization feature where child pages were incorrectly assumed to always be created under parent pages, even when the parent object was a database.What Changed
synchronizeChildNodemethod signature: Changed from acceptingparentPageId: stringto accepting bothparentObjectId: stringandparentObjectType: ObjectTypesynchronizeChildNodenow pass the correct parent object type (either'page'or'database') instead of hardcoding'page'Why This Change Was Needed
When using the
--flatoption with database synchronization, all markdown files become direct children of the database. However, the previous implementation hardcodedparentObjectType: 'page'when creating child pages, which caused issues when:This fix ensures that when syncing with
--flatto a database, child pages are correctly created as database items rather than attempting to create them as sub-pages of a non-existent parent page.Technical Details
The key changes are in
synchronize-markdown-to-notion.feature.ts:Line 251-252: Updated the initial call to
synchronizeChildNodeto passparentObjectTypebased on whetherrootPageElementexists (indicating a page parent) or not (indicating a database parent)Lines 437-448: Updated the
synchronizeChildNodemethod signature to acceptparentObjectIdandparentObjectTypeinstead of justparentPageIdLines 472-476: Updated the
createPagecall to use the passedparentObjectTypeinstead of hardcoding'page'Lines 495-498: Updated recursive calls to maintain the correct parent type (always
'page'for grandchildren since they're created under pages, not databases)Testing
--flatoption on database destination--flatoption on page destination--flatoption (existing behavior should remain unchanged)