Skip to content

Build your personal knowledge base with Trilium Notes

fix double import of auto generated link relations

zadam144e75da9e7b
diff --git a/src/services/import/tar.js b/src/services/import/tar.js
index 30ddc9d76e..c61cf4d338 100644
--- a/src/services/import/tar.js
+++ b/src/services/import/tar.js
@@ -150,6 +150,11 @@ async function importTar(importContext, fileBuffer, importRootNote) {
continue;
}
+ if (attr.type === 'relation' && ['internal-link', 'image-link', 'relation-map-link'].includes(attr.name)) {
+ // these relations are created automatically and as such don't need to be duplicated in the import
+ continue;
+ }
+
if (attr.type === 'relation') {
attr.value = getNewNoteId(attr.value);
}