Closed KevinBockelandt closed 4 years ago
Fixed by simply saving any buffer we open automatically. Which means new notes are always written to disk as soon as created. https://github.com/KevinBockelandt/notoire/commit/d1794844556d4ae1394cc5b1805e6a75db60753f
The problem comes from the way we compute the ID of a new note. We parse the content of the note folder and get the highest ID present +1.
Now imagine we create a note (ID 4) and in that note we want to create a link to a new note (should be ID 5). If we did not save note 4 before creating the new note, it's not saved to disk yet, which means that when parsing content of the note folder, the highest number is still 3.
So when we create what should be note 5, it will have the ID 4.