obsidianmd / obsidian-importer

Obsidian Importer lets you import notes from other apps and file formats into your Obsidian vault.
https://help.obsidian.md/import
MIT License
619 stars 53 forks source link

Notion Import: Import failure for items with identical names but different casing from Notion Database #223

Open felixqueisler opened 3 months ago

felixqueisler commented 3 months ago

When attempting to import a Notion database into Obsidian using the Obsidian Importer Plugin, I encountered an issue where items with the same name but different casing are not all successfully imported. In my case, the database contained three items: "MYITEM", "MYITEM", and "Myitem". The plugin managed to import the two items with the exact same case ("MYITEM" and "MYITEM 2"), but failed to import "Myitem", the item with a different case. The log indicated an error with the message "Error: File already exists.".

Steps to Reproduce:

  1. Create a Notion database containing at least three items with identical names, exact casing and differing in casing (e.g., "ITEMNAME", "ITEMNAME" and "Itemname").
  2. Use the Obsidian Importer Plugin to import the Notion database into Obsidian.
  3. Check the imported items in Obsidian and the import log for any errors.

Expected Behavior:

All items, regardless of case differences in their names, should be imported successfully into Obsidian. Items with the same name (case-insensitive) should be automatically renamed to prevent conflicts, similar to how duplicates with the exact same casing are handled ("ITEMNAME", "ITEMNAME 2", "Itemname 3").

Actual Behavior:

Only items with the exact same case are imported and renamed to avoid file-name duplication. Items with the same name and casing were imported ("ITEMNAME", "ITEMNAME 2") but differing in casing are not imported, resulting in a loss of data. The import log reports an "Error: File already exists." for the items that were not imported.

Possible Solution:

Implement a more robust check for item names that considers case differences, ensuring that all items are imported even if their names are identical when disregarded for case. Additionally, improve the automatic renaming mechanism to account for case differences, perhaps by appending numerical increments to similarly named items regardless of their case.

Environment:

Obsidian version: Version 1.5.11 (Installer 1.5.8) Obsidian Importer Plugin version: 1.6.0 Operating System and version: macOS 14.4 Additional Context: Import Log:

Failed: "Notion Backup.zip/Quittungen [REDACTED]/Myitem [REDACTED]..." because Error: File already exists.
Failed: "Notion Backup.zip/Quittungen [REDACTED]/Myitem [REDACTED]..." because Error: File already exists.

This issue results in incomplete data import from Notion, potentially affecting users migrating complex databases into Obsidian. I have not replicated and tested the fail-conditions. Please confirm the bug (especially if it occurs only with 3 or more same-name items and if casing is the actual condition).

ashaghal commented 3 weeks ago

I encountered the same problem as well. In my notion workspace i have many images, screenshots, with the same name like Untitled.png and the importer stocks while try to import these attachments image

obsidian version:1.6.3
impoter version: 1.6.2