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

Notion import error "Folder already exists" #83

Closed
Tracked by #84
Sinled opened this issue Aug 30, 2023 · 7 comments
Closed
Tracked by #84

Notion import error "Folder already exists" #83

Sinled opened this issue Aug 30, 2023 · 7 comments
Labels
bug Something isn't working notion

Comments

@Sinled
Copy link

Sinled commented Aug 30, 2023

Hi, there is an error with import plugin trying create folder that already exist, without any meaningful stack trace.

app.js:1 Uncaught (in promise) Error: Folder already exists.
    at t.<anonymous> (app.js:1:1024123)
    at app.js:1:236930
    at Object.next (app.js:1:237035)
    at a (app.js:1:235753)

I've downloaded and built plugin from code, and it seems problem is here in format-importer.ts

async createFolders(path: string): Promise<TFolder> {
    // ...
    let folder = this.vault.getAbstractFileByPath(normalizedPath);
    // ...
    await this.vault.createFolder(normalizedPath);

getAbstractFileByPath returns null if folder exist but have different case in name.
and when createFolder is trying to create folder but with different case - obsidian throws error.
I've replaced locally getAbstractFileByPath with getAbstractFileByPathInsensitive and after that it seems import works fine, but i'm not sure if this might break in some other place.

Also there is another bug - import won't do anything if notion export archive has nested archive with *-Part-1.zip in it.
In such case only one attachement folder with "part" archive in it created

@ericaxu ericaxu added the bug Something isn't working label Aug 30, 2023
@lishid
Copy link
Collaborator

lishid commented Aug 30, 2023

Also there is another bug - import won't do anything if notion export archive has nested archive with *-Part-1.zip in it.
In such case only one attachement folder with "part" archive in it created

I've removed the requirement for detecting the notion ID from the zip file - that should fix this part.

@j-palindrome
Copy link
Contributor

j-palindrome commented Sep 3, 2023

@Sinled Would it be possible to message me a .zip of your data or partial data showing the issue so I can work on debugging? You can share via Discord @joshua.palindrome or share with joshuatreinier@gmail.com on Dropbox or Google Drive

@Sinled
Copy link
Author

Sinled commented Sep 3, 2023

@joshuatazrein There are a lot of personal data, so i can't send it. I've tried to make smaller reproduction but for smaller export notion won't make nested archive. After that i've tried to make smaller archive with test data, but i cant find way to make archive nested directly in archive - mac os don't allow it, running zip from terminal on zip file also gives not result.

@j-palindrome
Copy link
Contributor

Understandable! Yeah I'm having trouble finding nested zips because I'm on a Mac.

@j-palindrome
Copy link
Contributor

I think the createFolders bug should be fixed in main, since that would potentially affect other plugins.

@j-palindrome
Copy link
Contributor

j-palindrome commented Oct 25, 2023

I believe this has been fixed by the change in createFolders.

@kepano
Copy link
Collaborator

kepano commented Nov 15, 2023

Closed via 1.5.5

@kepano kepano closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working notion
Projects
None yet
Development

No branches or pull requests

5 participants