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

Files, Images get deleted automatically after dragging them on to boostnote interface. #3203

Closed
VishwasGagrani opened this issue Aug 5, 2019 · 32 comments · Fixed by #3225
Closed
Labels
bug 🐛 Issue concerns a bug. level 2 ❗ A bug that causes major damage: App is barely usable, since major features are not working. needs investigation 🔬 Issue requires further investigation to locate or narrow down the problem.

Comments

@VishwasGagrani
Copy link

VishwasGagrani commented Aug 5, 2019

Current behavior

Let us know what is currently happening.
When dragging and dropping the files and images, it gets deleted automatically after some time. It does not happen always, but it happens say 30% of the times. The file cannot even be seen in recycle bin. For some reason, I am never able to put files with "psd" extension (photoshop files ) on boostnote. It does not even accept it. The issue is very similar to this link: #1788 . Since it says it's solved, I am submitting the issue again.

Expected behavior

The file should not get deleted. It should remain in the folder like any other files.

Steps to reproduce

  1. Select any image
  2. Drag and drop on the notes
  3. Sometimes it gets saved, however many times the image gets automatically removed either instantly or after some time. I cannot even find it in the recycle bin. It just vanishes to nowhere.

Environment

  • Boostnote Version : 0.12.1
  • OS Version and name : Mac
@Flexo013
Copy link
Contributor

Flexo013 commented Aug 5, 2019

Thanks for reporting the issue! I have a few questions:

  1. Just to double check that I understand the problem. When you drag an image onto a note in Boostnote the note in question sometimes gets deleted?

  2. Could you update Boostnote to the latest version (0.12.1) and see if the issue is still present?

As for photoshop files I don't think Boostnote currently supports .psd files. Supporting these files is not as trivial as regular images.

@Flexo013 Flexo013 added the needs investigation 🔬 Issue requires further investigation to locate or narrow down the problem. label Aug 5, 2019
@VishwasGagrani
Copy link
Author

Not the note in question. But the image being dragged and dropped. After showing up for some time, it suddenly gets deleted from the storage folder. The time it takes to get deleted and the type of image is random.
I am using 0.12.1 which is the latest.

I am not saying to show the preview of photoshop file. But unlike any other file like doc, zip, or fla etc which atleast creates a link if not the preview, psd file does not even drop on the note's interface. That is, when a psd file is dropped no link is created. As if no file was ever dropped there.

I hope I was clear. Thanks. :)

@Flexo013
Copy link
Contributor

Flexo013 commented Aug 6, 2019

Hmmm, that's very strange. I haven't been able to reproduce this behavior so far. Is there any more info you can give? What is the fastest an image got deleted after adding it? Does it happen after just starting Boostnote? Anything particular that you do or noticed around this bug?

Hopefully that will help with narrowing down this issue.

When I try dragging a psd file onto Boostnote (from the Windows File Explorer) I get a working link:
image
And clicking it opens the file in Photoshop.

Where are you dragging the file from?

@VishwasGagrani
Copy link
Author

VishwasGagrani commented Aug 6, 2019

See how it behaves when I try to upload psd files. In fact, it's doing the same with keynote files with extension (.key). However with key notes files there is a possibility that the application might be seeing it as a folder. Because keynote files are actually folders with .key extension, on mac. And boostnote does not allow putting folders as I understand.

https://drive.google.com/open?id=1n13XpYMpXBWkRFVcTMAYVB-srb4zCHmK

Another major problem as I said before is "content loss", the files disappear mysteriously. Today I copied a link from one storage folder to another storage folder. But on pasting it showed me a message that I am not allowed to paste it from another storage folder. That's fine. But when I tried to paste the file link back, it had already gone. And there was no Ctrl + z option. I tried to see it in recycle bin, but could not see anything there. My question: How do the files get deleted in this application? I suggest it should go to recycle bin, instead of overwriting. Because this leads to a major content loss issue. :)

@VishwasGagrani
Copy link
Author

For example, when I opened a note today it showed 2 images vanished. In fact if you are lucky and have the notes attachment folder opened, you may even see the file getting created and for some reason vanishes away after some time.

Screen Shot 2019-08-06 at 11 40 20 AM

@VishwasGagrani
Copy link
Author

VishwasGagrani commented Aug 6, 2019

I looked into developer tools, and I saw some errors at main.js 7705:

File "/mac-st./../..ign/notes/attachments/9fc24eea-5d9d-4f93-8644-36c3fe4fccc4/f8b47aff.png" deleted because it was not included in the content of the note

What does that mean? I am not sure, but I don't remember I manually deleted anything from attachment folder. Does this give any pointers?

My suggestion is you probably should not allow any type of deletion by the application. It can be disastrous in case there is some bug in algorithm. In a similar app called zim-notes, they just show the attachment folder as a side panel. So that the user always know the files available in the attachment folder, even if he deletes the link for some reason.

@VishwasGagrani
Copy link
Author

As a temporary solution I searched Main.js in "compiled" folder and commented this section:

files.forEach(function (file) {
if (!attachmentsInNoteOnlyFileNames.includes(file)) {
/var absolutePathOfFile = path.join(targetStorage.path, DESTINATION_FOLDER, noteKey, file);
fs.unlink(absolutePathOfFile, function (err) {
if (err) {
console.error('Could not delete "%s"', absolutePathOfFile);
console.error(err);
return;
}
console.info('File "' + absolutePathOfFile + '" deleted because it was not included in the content of the note');
});
/
}

I hope files should not get deleted now. Not sure what side effects it may have.

@Flexo013
Copy link
Contributor

Flexo013 commented Aug 6, 2019

Thanks for the very detailed info! This should definitely help with understanding what is going on.

I still can't quite reproduce the issue on Linux or Windows. From other reports/issues it might be a bug that is exclusive to Mac, which makes it a little more difficult to test.

It might be caused by something like this, but this is merely a guess. The problem with "moving" an attachment from one note to another could be the following:

Do you also lose images (or file copies) if you haven't moved them between notes?

@VishwasGagrani
Copy link
Author

Yes, that can be one of the reasons. That is the scenario when cutting and pasting from note to note, or note from one storage folder to another etc. But in many scenarios the files get deleted as soon as I drag from outside on to the note interface. Why this happens? And why is it selective about the type of file, as I said, it does not accept psd file.

PS: Also this disappearance of files I have seen only with image files. I have not seen it with files of other extensions till now.

@ehhc
Copy link
Contributor

ehhc commented Aug 8, 2019

Thanks for the very detailed info! This should definitely help with understanding what is going on.

I still can't quite reproduce the issue on Linux or Windows. From other reports/issues it might be a bug that is exclusive to Mac, which makes it a little more difficult to test.

It might be caused by something like this, but this is merely a guess. The problem with "moving" an attachment from one note to another could be the following:

* When you cut the out the image/file line of the original note

* Boostnote notices that it has an attachment that is no longer used (because the line is gone)

* After 30 seconds Boostnote cleans up the unused attachment and deletes the file (see #3107)

* When you paste the line referring to the attachment it is now gone

Do you also lose images (or file copies) if you haven't moved them between notes?

From reading the issue, i thought about the same reason you describe as well...
@VishwasGagrani can you try if it also happens if you Copy&paste the link instead of Cut&Paste it?

Unfortunately, i'm not able to reproduce mac issues because i don't have a private mac..

@Joe-Luo-1994
Copy link

Joe-Luo-1994 commented Aug 13, 2019

Hi there,
I'm just having the same issue on Windows.

Steps to Reproduce


  • Copy a picture on a website and paste it into boostnote
  • At first, it displayed properly
  • After a few hours (sometimes minutes), some pictures just vanished and couldn't be found in the folder or recycle bin.

image

Besides images, the issue happened on pdf file as well.

Steps to Reproduce


  • Drag a pdf file from a local folder and move it into boostnote
  • Open the file from boostnote, everything works fine, and close the file without editing.
  • After a random time, some files just vanished and couldn't be found in the folder or recycle bin.

Environment


Boostnote Version: 0.12.1
OS Version: Windows 10

@ronaldl
Copy link

ronaldl commented Aug 16, 2019

I'm seeing the same behavior.

Boostnote Version: 0.12.1
OS Version: macOS Mojave 10.14.6

@DemonElite
Copy link

I am troubled by the same problem
sometimes, the file was inexplicably deleted

@Flexo013
Copy link
Contributor

I have so far been unable to reproduce this issue. I'm wondering if this might be due to my Boostnote storage folder being synced (with MEGA).

@DemonElite @ronaldl @j892020 @VishwasGagrani Are any of you using any kind of automatic cloud saving of your notes?
If you aren't then could you try using something like this and see if the issue still occurs?

I don't expect it to make a difference, but I just want to make sure. The main reason this probably won't help is because the cloud saving should simply delete the file/attachment when Boostnote deletes it (even if Boostnote mistakenly does so).

@Flexo013 Flexo013 added bug 🐛 Issue concerns a bug. level 1 ❕ A bug that caused minor damage: App is still usable, but minor features might not work. labels Aug 20, 2019
@ronaldl
Copy link

ronaldl commented Aug 20, 2019

I've seen this behavior when syncing with OneDrive and pCloud.

@VishwasGagrani
Copy link
Author

I am already using Google Drive. However the issue is related with Boostnote only. I have commented the line in Main.js of Boostnotes, and I have not faced any such problem after that. So if it's an emergency situation for any boostnote user, then you can do that temporary patching as I did, till this issue is solved completely.

#3203 (comment)

@Joe-Luo-1994
Copy link

I was using Google Drive. After having the issue, I stop using cloud-saving and change the storage folder to a local one. The problem still exists, and then I report it here.

@niklas2810
Copy link

I have commented the line in Main.js of Boostnotes, and I have not faced any such problem after that. So if it's an emergency situation for any boostnote user, then you can do that temporary patching as I did, till this issue is solved completely.
#3203 (comment)

I am facing the same issue, now using the workaround as well. I am not using Google Drive or OneDrive (or any other syncing application).

@Diomas
Copy link

Diomas commented Aug 26, 2019

This attachment files cleanup mechanism is annoying me since i've started using boostnote. I like the app, but i've lost so many attached files until I commented out these lines:

      const {
        storageKey,
        noteKey
      } = this.props
      attachmentManagement.deleteAttachmentsNotPresentInNote(
        this.editor.getValue(),
        storageKey,
        noteKey
      )

It could make some sense if the app would wait until it's closed or started next time to do cleanup things. Otherwise all copy/pasting/dragging operations are not safe for your data

@Flexo013 Flexo013 added level 2 ❗ A bug that causes major damage: App is barely usable, since major features are not working. and removed level 1 ❕ A bug that caused minor damage: App is still usable, but minor features might not work. labels Aug 26, 2019
@ehhc
Copy link
Contributor

ehhc commented Aug 26, 2019

This attachment files cleanup mechanism is annoying me since i've started using boostnote. I like the app, but i've lost so many attached files until I commented out these lines

It annoyed you such a long time and you didn't think about creating a solution suitable for the other users as well...? Tbh: that's quite egoistic..

@Flexo013
Copy link
Contributor

Not sure if #3225 can count as a proper fix for this issue.

The behavior reported by many people here should not occur. Having the option to "disable" this bug by doing the process manually isn't a full fledged fix. It's a patch that provides a temporary solution as users have to enable the options themselves. Meaning that with default settings this issue will still occur.

Reopening this issue until it is also fixed with default settings.


Note that we could simply make the manual cleaning of attachments the default setting. Maybe add a warning when our detection says you have more than 1GB of unreferenced attachments. That way we no longer have this issue of deletion happening at the wrong time.

@Flexo013 Flexo013 reopened this Aug 30, 2019
@matg19
Copy link

matg19 commented Sep 8, 2019

I have exactly the same problem (Windows user here). My solution so far is to have Boostnote in Dropbox, so that when Boostnote randomly decides to delete some images I can go to Dropbox bin and restore them (since it does not delete them to the Bin using Windows bin is of no use).

Commenting out those lines seems to work so far for me.

@federicochiesa
Copy link

I have a similar problem with images disappearing from my notes after a while and showing the broken image icon. They just disappear, they're not in the recycle bin or anywhere else, they just vanish.
This has caused a lot of damage to my older notes as I don't have the original files and I don't know where to look for them.

@AgarwalPragy
Copy link

Facing the same issue.

  • This happens even if you paste the image from clipboard
  • Doesn't happen with every image - just a few random images get deleted from notes
  • the attachments folder where the image resided still remains. Just the image vanishes

@ehhc
Copy link
Contributor

ehhc commented Oct 8, 2019

I'm very sorry to hear about your problems. Unfortunately, i have no idea how i can try to solve a problem that only happens "randomly"..
Furthermore, without a new release (which i cannot influence, but only @Rokt33r ) the option to turn the auto-deletion off will not be available.. :( Sorry that i cannot help you :(

@AgarwalPragy
Copy link

I'm very sorry to hear about your problems. Unfortunately, i have no idea how i can try to solve a problem that only happens "randomly"..
Furthermore, without a new release (which i cannot influence, but only @Rokt33r ) the option to turn the auto-deletion off will not be available.. :( Sorry that i cannot help you :(

Thanks for your concern. A temporary fix for everyone would be to keep your notes folder under a git repo, and commit every now and then.
That way, you can always recover any deleted files and fix damaged notes.

@Flexo013
Copy link
Contributor

As of 0.13.0 unused attachments should no longer be deleted by default. They can be cleared in the preferences:
image

This is a patch for this issue. In the future this issue might be reopened or referenced when looking for the root cause of this issue. For now I'm closing it.

If attachments still get deleted then reopen this please.

@AndrinGautschi
Copy link

AndrinGautschi commented Jan 8, 2020

This issue still exists at least on macOS Catalina 10.15.2 with background sync to OneDrive.

Solution is to restore the deleted files in the OneDrive bin which is (obviously) very annoying.

I disabled the "Delete files if not referenced anymore" for now to experiment if this solves the problem somehow.

@VishwasGagrani
Copy link
Author

The developers are updating boostnote but not able to sort out this crucial problem. This is a very serious issue. I have to comment the particular section on every update of boostnote.

@arcturus140
Copy link
Contributor

@AndrinGautschi I don't think it'll make a difference 😞

@VishwasGagrani
Copy link
Author

@AndrinGautschi I don't think it'll make a difference 😞

It's working for me.

@Flexo013
Copy link
Contributor

Flexo013 commented Jan 9, 2020

@VishwasGagrani @AndrinGautschi Let's continue this discussion in #3424

@BoostIO BoostIO locked and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Issue concerns a bug. level 2 ❗ A bug that causes major damage: App is barely usable, since major features are not working. needs investigation 🔬 Issue requires further investigation to locate or narrow down the problem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.