Snippet-type notes fail to save / load correctly #2202
urda posted onGitHub
Current behavior
I'm unable to trust in using snippet-type notes within Boostnote. This issue reports a bug that makes those types of notes appear to save incorrectly and load incorrectly. For a user who may not be paying careful attention, this may mean a loss of notes if not caught by the end user!
This is what a user will be greeted with when a snippet note is damaged:
Expected behavior
Snippet notes save and load as expected, every time.
Steps to reproduce
Open
Boostnote
.Select any
Folder
from yourStorage
locations.Click
Make a note
next to theSearch
area.Select
Snippet Note
.Observe that a new note is ready for input, showing the following details:
Add tag...
Description...
Unnamed
as the first "snippet".
Observe the following
cson
that is generated:createdAt: "2018-07-12T22:35:07.105Z" updatedAt: "2018-07-12T22:35:07.105Z" type: "SNIPPET_NOTE" folder: "47ac063fd1f9b6796455" title: "" description: "" snippets: [ { name: "" mode: "text" content: "" } ] tags: [] isStarred: false isTrashed: false
Type
I'm adding content here now.
inside the editor section for theUnnamed
tab.Click on the plus sign to the right of the
Unnamed
tab.Name new tab
content.java
and placeI'm adding java content here now.
inside it.Rename the
Unnamed
tab tocontent.md
.Click away to another note.
Observe UI is unchanged, click on another note. Observe UI changed.
Click back to the
Empty note
you created during step 4. Notice the UI is now white, and content is missing from the editor in thecontent.java
tab.Within the developer tools console, the following error can be observed:
Uncaught TypeError: Path must be a string. Received undefined at assertPath (path.js:28:11) at Object.join (path.js:1251:7) at createAttachmentDestinationFolder (file:///Applications/Boostnote.app/Contents/Resources/app/compiled/main.js:7797:26) at Object.migrateAttachments (file:///Applications/Boostnote.app/Contents/Resources/app/compiled/main.js:7813:8) at MarkdownPreview.rewriteIframe (file:///Applications/Boostnote.app/Contents/Resources/app/compiled/main.js:22188:29) at MarkdownPreview.componentDidMount (file:///Applications/Boostnote.app/Contents/Resources/app/compiled/main.js:22064:13) at e.notifyAll (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:10:7915) at r.close (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:12:18446) at r.closeAll (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:13:9933) at r.perform (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:13:9428) at o.perform (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:13:9345) at o.perform (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:12:24877) at Object.k [as flushBatchedUpdates] (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:12:25046) at r.closeAll (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:13:9933) at r.perform (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:13:9428) at Object.batchedUpdates (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:12:4379) at Object.u [as enqueueUpdate] (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:12:23934) at r (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:12:21663) at Object.enqueueSetState (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react-dom/dist/react-dom.min.js:12:22781) at DebouncedContainer.r.setState (file:///Applications/Boostnote.app/Contents/Resources/app/node_modules/react/dist/react.min.js:10:2901) at DebouncedContainer.<anonymous> (file:///Applications/Boostnote.app/Contents/Resources/app/compiled/main.js:29806:21) at invokeFunc (/Applications/Boostnote.app/Contents/Resources/app/node_modules/lodash/lodash.js:10333:23) at trailingEdge (/Applications/Boostnote.app/Contents/Resources/app/node_modules/lodash/lodash.js:10382:18) at timerExpired (/Applications/Boostnote.app/Contents/Resources/app/node_modules/lodash/lodash.js:10370:18)
Observe the following
cson
that is generated:createdAt: "2018-07-12T22:35:07.105Z" updatedAt: "2018-07-12T22:36:32.777Z" type: "SNIPPET_NOTE" folder: "47ac063fd1f9b6796455" title: "" description: "" snippets: [ { name: "content.md" mode: "Markdown" content: "I'm adding content here now." } { name: "content.java" mode: "Java" content: "I'm adding java content here now." } ] tags: [] isStarred: false isTrashed: false
Report this bug to Boostnote (here we are).
Additional Observations
Once a note enters this condition, the note can no longer be "deleted" from storage. The
cson
file must be manually removed.The actual content appears to be saved, but I'm also a technical user who can dig around an open source project myself.
- ⚠️⚠️⚠️
- A not-so-technical user will consider their notes lost in this type of situation. A notebook application that can't be trusted to save notes is a very bad thing to demonstrate to Boostnote users!
- ⚠️⚠️⚠️
Environment
- Version:
Version 0.11.7 (0.11.7)
- OS Version and name:
macOS High Sierra, Version 10.13.5