fix: preserve page hierarchy and property links in File-to-DB imports - #13188
fix: preserve page hierarchy and property links in File-to-DB imports#13188antoniel wants to merge 2 commits into
Conversation
Preserve namespace ordering, tag identities and property links during File-to-DB import. Batch renderer finalization and report progress with regression coverage.
|
With I think the better way is the importer detect this conflict and explicitly report that the graph cannot be imported with the current options. It should ask the user to rename the conflicting tag, or rename the parent page and update its namespace references, or remove the child page. Adding an order to child or keeping father out of Library does not resolve the conflict. The resulting parent–child relationship would still violate the DB model. |
|
That makes sense, I agree. I’m happy to update the implementation Should we detect these conflicts in the import modal and block the import before it starts? My concern is that some graphs might have thousands of these cases. Could we offer a bulk fix, like renaming conflicting tags to What approach would you prefer? I can adjust the PR accordingly |
Keep the current import lifecycle and class/property handling while preserving the remaining exporter fixes and regression tests.
|
In fact, there is one more scenario that can also lead to the same issue, for example, both of these inputs conflict with the DB model:
In the DB model, the parent of a page must also be a page. I think we better give the choice to the user, and the importer should detect the conflict before importing, stop the import, and ask the user to resolve the source data. The message should identify the conflicting namespace parent and explain the available options:
|
Summary
Fix legacy File-to-DB imports that leave namespace pages with invalid child order or broken property references.
Related to logseq/db-test#1076. This addresses import data integrity and finalization responsiveness; it does not claim to resolve every worker reconnection failure reported there. Overlaps with #12961 on built-in tag/property collisions; this approach preserves the tag as a separate class.
Validation
bb lint:devpassed.The broader dependency run also exposed a failing
logseq.graph-parser.block-test/existing-journal-reference-reuses-stored-identity-testassertion (journal display format); that parser path is unchanged by this PR. Dependency suites require their own working directories.No schema changes or migration required; fixes apply to new imports. Batching is covered by timer-yield assertions, without an import-speed benchmark claim.