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

[Evernote] Fails to set some notes' dates #194

Closed
Tracked by #204
przemhb opened this issue Jan 1, 2024 · 6 comments
Closed
Tracked by #204

[Evernote] Fails to set some notes' dates #194

przemhb opened this issue Jan 1, 2024 · 6 comments
Labels
bug Something isn't working cannot reproduce evernote

Comments

@przemhb
Copy link

przemhb commented Jan 1, 2024

I have just used 1.5.6 to import ENEX notes. Some of the 394 notes were not set dates according to the ones stored in the ENEX file. I end up with writing Python code to fix this. Interestingly os.utime() failed to set those dates also and I was forced to use win32file.SetFileTime().

@kepano kepano changed the title Fails to set some notes' dates [Evernote] Fails to set some notes' dates Jan 25, 2024
@kepano kepano added evernote bug Something isn't working labels Jan 25, 2024
@kepano kepano mentioned this issue Jan 26, 2024
9 tasks
@akosbalasko
Copy link
Contributor

Hi @przemhb ,
Could you please give us a bit more details about the problematic notes? Do you see any aspect that distinguishes the failed ones from the notes converted correctly? The key point would be that what you recognized, the failure of os.utime().
Thanks a lot!

@przemhb
Copy link
Author

przemhb commented Jan 29, 2024

Hi @akosbalasko

just tried to recreate the problem to give you some insight or attach some problematic notes, but... to my surprise another import of the same ENEX resulted in flawless import. But how can it be? The same ENEX, the same Obsidian and Importer. Could it be, that some bug in underlying Python library was fixed in between?

What I have changed for the test was the ENEX filename and selected to put output notes in a folder. The folder did not have " ' " in its name.

@akosbalasko
Copy link
Contributor

@przemhb , it's strange definitely.
But what you mentioned in your first comment made me think: "Interestingly os.utime() failed too". It would mean that something has failed on a deeper level.
I checked the code and fs.utimesSync (os.utime equivalent in NodeJS) is not covered by try-catch, so if it fails, it will make the whole note-conversion fail, even if everything goes well until that point. I think handling possible exceptions in this function would be a good patch.
May I ask what you saw as a failure?

@przemhb
Copy link
Author

przemhb commented Jan 30, 2024

@akosbalasko In the case of failed import a note's modification date and time was not set as in the ENEX file, but to current time (or creation time - not 100% sure after those few weeks). As an effect sorting by modification date was flawed with some old notes appearing on the top of the list.

@akosbalasko
Copy link
Contributor

@przemhb , okok thanks! And when you run the import last time, you mentioned that it went well flawlessly. Do you mean that the import itself worked well and set the correct creation dates without the python script?

@przemhb
Copy link
Author

przemhb commented Jan 30, 2024

@akosbalasko yes, import alone went just fine, so I wasn't forced to use my python script. Modification dates were as in source ENEX.

akosbalasko added a commit to akosbalasko/obsidian-importer that referenced this issue Jan 31, 2024
@kepano kepano closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cannot reproduce evernote
Projects
None yet
Development

No branches or pull requests

3 participants