Boostnote: Images lost after sync over git

Created on 27 Jun 2018  路  13Comments  路  Source: BoostIO/Boostnote

Current behavior

I use boostnotes on windows at work and on linux at home. I sync using git.
My routine is like this:

  1. Pull notes from git
  2. Edit notes
  3. Push notes to git

When I pull from git on linux machine, images do not appear.
The links appear correct. But the images are not present.
So I replaced the boostnotes storage content with files downloaded from git (as opposed to pull etc.). Still images are not displayed.

Expected behavior

I expect the notes to be same when I download / sync up with git on linux.
The images should be displayed if they are present in the attachments// folder.
Is my expectation correct?
Currently images are not displayed.

Steps to reproduce

  1. Edit notes on Windows, add some images from clipboard etc.
  2. Push the changes to git
  3. Pull in the changes from git on linux machine
  4. Launch boostnote.

Environment

  • Version :0.11.6
  • OS Version and name : Arch Linux
bug

Most helpful comment

This should be a high-priority bug to resolve.

In order of priority, I would suggest to:

  • Disable this autoremove attachments feature.

    • It's not so nice to lose files... not just because of the platform dependent thing, but consider the case when you want to move the screenshot, you cut the text ":storage/foo/bar.png", and then there is a high chance you will lose the file because you didn't paste it on time (ie: onBlur event)
  • Use a cross-platform way to reference the file (ie: use always forward slash '/' and inside the code do the dirty-work to handle the final os.path)

  • Make this feature configurable (I would suggest leaving it off by default, but this is just a personal preference)

All 13 comments

@ytee Boostnote saves images in /storagepath/images . Did you include /images in your git repository?

@sosukesuzuki , yes I sync all the folders in git. My folder structure is as follows in both Windows, Linux & git:

  • boostnote.json
  • notes
  • attachments
    In attachments folder, I do have several folders with images.
    It works fine on windows. But on linux I can't see the images in boostnote even though the images are present.

@ytee Hmm..., I'll try to research this bug.

I can confirm this issue.

Two questions:

  • are your images in :storageLocation/attachments or in :storageLocation/attachments/NOTEKEY where NOTEKEY is a hash string?
  • are you getting any errors in the developer console?

The console shows

Failed to load resource: net::ERR_FILE_NOT_FOUND
File "/home/stefan/workspace/notes/attachments/b54522b5-fd1a-480a-9b75-27f583c6b22c
/2606db30.jpg" deleted because it was not included in the content of the note

Markdown is

![foo](:storage\b54522b5-fd1a-480a-9b75-27f583c6b22c\2606db30.jpg)

The image has been added by dragging it to the editor.

any progress here?

Hi,
i think the problem is the following:
1) the path how attachments are referenced in the markdown is platform dependent (stupid me..).
2) When leaving a note (onBlur) the app tries to delete all attachments not referenced in the note (e.g. not needed anymore)
3) because you use different platforms on windows your markdown reference contains \ as separators.. On linux the app expects /
4) due to 3) the app don't recognizes the references in your markdown as attachments -> It deletes the actual attachments because it thinks they are not referenced (e.g. not needed).

Possible solution: make the delete-unused-attachments-feature possible to disable.. that would not fix the issue but at least would be a workaround..

Unfortunately i don't have that much time at the moment.. i will have a look when i can do it

Thanks for the update, I'll keep my fingers crossed. 馃憤

@ehhc , Thanks for the update. I am just eager to have the work around for now because this is part of my regular workflow.

This should be a high-priority bug to resolve.

In order of priority, I would suggest to:

  • Disable this autoremove attachments feature.

    • It's not so nice to lose files... not just because of the platform dependent thing, but consider the case when you want to move the screenshot, you cut the text ":storage/foo/bar.png", and then there is a high chance you will lose the file because you didn't paste it on time (ie: onBlur event)
  • Use a cross-platform way to reference the file (ie: use always forward slash '/' and inside the code do the dirty-work to handle the final os.path)

  • Make this feature configurable (I would suggest leaving it off by default, but this is just a personal preference)

Thanks @saaguero for #2205, I can confirm your fix works on Windows-Linux, too.

@ytee, could you please confirm as well and close this issue? Thanks a lot.

@xephon2, @saaguero I can confirm that it is working on linux. All the images that were missing before are now visible. I will confirm Windows' side of things tomorrow.
Thank you boostnote team & everyone involved for the awesome work !!

Was this page helpful?
0 / 5 - 0 ratings