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

Export > MD on a Joplin note has surprising behaviour #11606

Open
krallus opened this issue Jan 8, 2025 · 4 comments
Open

Export > MD on a Joplin note has surprising behaviour #11606

krallus opened this issue Jan 8, 2025 · 4 comments
Labels
bug It's a bug

Comments

@krallus
Copy link

krallus commented Jan 8, 2025

Operating system

Linux

Joplin version

3.2.8

Desktop version info

Joplin 3.2.8 (prod, linux)

Client ID: 0212406b09af49f183a2d0c21dbe3ae2
Sync Version: 3
Profile Version: 47
Keychain Supported: No

Revision: d458648

Backup: 1.4.2
Freehand Drawing: 2.13.0

Current behaviour

  1. Right-click on a note
  2. Select Export
  3. Select "MD - Markdown" (or "MD - Markdown + Frontmatter")
  4. "Select Folder" window appears. Unlike with exporting to a PDF, it is not a "Save File" window which is what one would expect, especially for exporting a single note.
  5. Selecting a folder and clicking "Open" causes the "Select Folder" window to disappear.
  6. No file is created in the selected folder. However:
  • Unexpectedly, an empty _resources folder is created.
  • A directory hierarchy reflecting the notebook(s) the selected note is found in is created and an automatically named .md file is found at the deepest level of the hieararcy.

Expected behaviour

At step 4, I would expect a "Save File" window to appear, pre-populated with a filename that includes the ".md" extension. Then, clicking save would create the given file with the markdown of the selected note.

NOTE: exporting for other file types, such as PDF, works as expected.

Logs

/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:29895 Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtoolsYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq
main-html.js:65 Environment: prod
main-html.js:87 appId: net.cozic.joplin-desktop
main-html.js:89 appType: desktop
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: Profile directory: /home/hacheyp/.config/joplin-desktop
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: Root profile directory: /home/hacheyp/.config/joplin-desktop
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: Database was open successfully
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: Checking for database schema update...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: Current database version Object
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: Upgrading database from version 47
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: New version: 47. Previously recorded version: 47
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: KeychainServiceDriver.electron: KeychainService Linux backend:  gnome_libsecret
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: KeychainService: Driver unsupported:node-keytar
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: KeychainService: checking if keychain supported
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: KeychainService: check was already done - skipping. Supported: 1
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Master password is not set - trying to get it from the active master key...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: handleSyncStartupOperation: Processing operation: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: Client ID: 0212406b09af49f183a2d0c21dbe3ae2
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: models/Setting: Applying default migrations...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Trying to load 0 master keys...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Loaded master keys: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: ResourceFetcher: Auto-add resources: Mode: always
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: permanentlyDeleteOldData: Processing items older than 7776000000ms...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: ResourceFetcher: Auto-added resources: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: permanentlyDeleteOldData: Items to permanently delete: Object
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: checkDisabledSyncItemsNotification: No errors: Hiding notification
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: "syncInfoCache" was changed - setting up encryption related code
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Trying to load 0 master keys...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Loaded master keys: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: "syncInfoCache" was changed - setting up encryption related code
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Trying to load 0 master keys...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Loaded master keys: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: "syncInfoCache" was changed - setting up encryption related code
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Trying to load 0 master keys...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Loaded master keys: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: app.start: doing regular boot
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: "syncInfoCache" was changed - setting up encryption related code
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Trying to load 0 master keys...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Loaded master keys: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: "syncInfoCache" was changed - setting up encryption related code
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Trying to load 0 master keys...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Loaded master keys: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: App: "syncInfoCache" was changed - setting up encryption related code
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Trying to load 0 master keys...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: e2ee/utils: Loaded master keys: 0
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: RevisionService: runInBackground: Starting background service with revision collection interval 600000
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: PluginService: Loading plugin from /home/hacheyp/.config/joplin-desktop/cache/io.github.jackgruber.backup
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: PluginService: Loading plugin from /home/hacheyp/.config/joplin-desktop/cache/io.github.personalizedrefrigerator.js-draw
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:51: SpellCheckerServiceDriverNative: Set effective languages to "en-CA"
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: DecryptionWorker: cannot start because no master key is currently loaded.
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: Preparing scheduled sync
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: Saving updated Dropbox auth.
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: Starting scheduled sync
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: Synchronizer: Sync: starting: Starting synchronisation to target 7... supportsAccurateTimestamp = false; supportsMultiPut = false} [1736356072547]
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: Synchronizer: Indexing resources...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: ResourceService::indexNoteResources: Start
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: joplin.plugins: Starting plugin: io.github.personalizedrefrigerator.js-draw
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: joplin.plugins: Starting plugin: io.github.jackgruber.backup
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:798 Unrecognized feature: 'clipboard-write=(self)'.
setValueForProperty @ /tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:798
Show 1 more frame
Show less
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:52: useFormNote: Sync has finished and note has never been changed - reloading it
useMessageHandler.ts:31 Got ipc-message: noteRenderComplete undefined
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:53: joplin.plugins: Finished running onStart handler: io.github.personalizedrefrigerator.js-draw (Took 687ms)
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:53: ResourceService::indexNoteResources: Completed
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:53: joplin.plugins: Finished running onStart handler: io.github.jackgruber.backup (Took 801ms)
useMessageHandler.ts:31 Got ipc-message: noteRenderComplete undefined
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:54: Synchronizer: Sync target remote info: Object
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:54: Synchronizer: Sync target is already setup - checking it...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:54: Synchronizer: Sync target local info: Object
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:55: RevisionService: maintenance: Starting...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:55: RevisionService: maintenance: Service is enabled
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:55: RevisionService: collectRevisions: Created revisions for 0 notes
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:55: RevisionService: maintenance: Done in 103ms
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: supportsDeltaWithItems =  false
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: Sync: fetchingTotal: Fetching delta items from sync target
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: Sync: finished: Synchronisation finished [1736356072547]
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: Operations completed: 
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: fetchingTotal: -
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: Total folders: 56
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: Total notes: 246
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Synchronizer: Total resources: 47
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: checkDisabledSyncItemsNotification: No errors: Hiding notification
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Updating all notifications...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:56: Garbage collecting alarms...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:07:57: DecryptionWorker: cannot start because no master key is currently loaded.
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:08:01: SearchEngine: Updating FTS table...
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:08:01: Updating items_normalized from Object
/tmp/.mount_JoplincvNcDw/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:259 12:08:01: SearchEngine: Updated FTS table in 3ms. Inserted: 0. Deleted: 0
node:internal/timers:581 12:08:21: ResourceService::indexNoteResources: Start
node:internal/process/task_queues:95 12:08:21: ResourceService::indexNoteResources: Completed
node:internal/process/task_queues:95 12:08:21: ResourceService::deleteOrphanResources:
node:internal/timers:581 12:08:31: SearchEngine: Updating FTS table...
node:internal/process/task_queues:95 12:08:31: Updating items_normalized from {updated_time: 0, id: ''}
node:internal/process/task_queues:95 12:08:31: SearchEngine: Updated FTS table in 3ms. Inserted: 0. Deleted: 0
InteropServiceHelper.ts:217 Export result:  {warnings: Array(0)}warnings: Array(0)length: 0[[Prototype]]: Array(0)at: ƒ at()concat: ƒ concat()constructor: ƒ Array()copyWithin: ƒ copyWithin()entries: ƒ entries()every: ƒ every()fill: ƒ fill()filter: ƒ filter()find: ƒ find()findIndex: ƒ findIndex()findLast: ƒ findLast()findLastIndex: ƒ findLastIndex()flat: ƒ flat()flatMap: ƒ flatMap()forEach: ƒ forEach()includes: ƒ includes()indexOf: ƒ indexOf()join: ƒ join()keys: ƒ keys()lastIndexOf: ƒ lastIndexOf()length: 0map: ƒ map()pop: ƒ pop()push: ƒ push()reduce: ƒ reduce()reduceRight: ƒ reduceRight()reverse: ƒ reverse()shift: ƒ shift()slice: ƒ slice()some: ƒ some()sort: ƒ sort()splice: ƒ splice()toLocaleString: ƒ toLocaleString()toReversed: ƒ toReversed()toSorted: ƒ toSorted()toSpliced: ƒ toSpliced()toString: ƒ toString()unshift: ƒ unshift()values: ƒ values()with: ƒ with()Symbol(Symbol.iterator): ƒ values()Symbol(Symbol.unscopables): {at: true, copyWithin: true, entries: true, fill: true, find: true, …}[[Prototype]]: Object[[Prototype]]: Object
@krallus krallus added the bug It's a bug label Jan 8, 2025
@krallus krallus changed the title Export > MD does not produce a file Export > MD on a Joplin note has surprising behaviour Jan 8, 2025
@mrjo118
Copy link
Contributor

mrjo118 commented Jan 12, 2025

It sounds like it might be failing due to something specific in your note data. Would you be able to export your notes in batches (rather than all at once), then when it fails split the batch into smaller batches, until it can be narrowed down to a single note. Then if you duplicate that note and strip the contents bit by bit until if stops failing to export that note, you might be able to identify what specifically in the note is causing the export issue, so you could provide a sample

@krallus
Copy link
Author

krallus commented Jan 14, 2025

I just tried this with the note that Joplin starts with called "1. Welcome to Joplin! 🗒️" in the Notebook called "Welcome! (Desktop)". I vaguely recall that it was originally just "Welcome!" and I renamed it.

This is what happened:

  1. Right click on "1. Welcome to Joplin! 🗒️"
  2. Selected Export -> "MD - Markdown"
  3. The "Select Folder" window appears
  4. I select a folder (in my case, ~/temp) and click Open
  5. The "Select Folder" window disappears.
  6. When I look in the folder I selected (~/temp), I do not see any .md file created as I would have expected. However, there is a new folder called ~/temp/Welcome! (Desktop), which is the name of the containing Notebook. It's easy to miss when I was expecting a .md file to be created directly in the ~/temp folder, which happens to contain many other files and folders.
  7. There is also a file called ~/temp/Welcome! (Desktop)/1. Welcome to Joplin! 🗒️.md, which is the export of the selected note. It does not contain any other .md files and so it only exported the selected note and not all of the notes from the "Welcome! (Desktop)" notebook.
  8. There is also a new folder called ~/temp/_resources containing the files SubNotebooks.png and AllClients.png. So, I now know what the purpose of the _resources folder is: it contains files/images that the exported .md file links to.

So, the export does happen. It's just not very obvious when I am expecting it to work more like "Export -> PDF - PDF File" where the export is simply saved to the file whose name you specify.

If what I described is how it's supposed to work, then it would be wrong to call this a "bug", but it's perhaps a usability issue since it's non-intuitive. What would be intuitive is having the .md file created directly in the selected folder without creating any subfolders.

@mrjo118
Copy link
Contributor

mrjo118 commented Jan 14, 2025

It looks to behave the same on Windows as well. To be honest it sounds like this is by design. If you export a single note to markdown then you can't necessarily export the note in a single file, because it could contain attachments which will be put in the _resources folder. For pdf and html export, they always export a single file as the attachments are embedded, hence you can have a save file dialog instead (if it is just 1 note selected)

@krallus
Copy link
Author

krallus commented Jan 14, 2025

I do not disagree. I just wish it had all been a bit more obvious what it was doing because the first few times, I was left with the impression that it was doing nothing since it wasn't doing what I intuitively expected. But maybe that's just me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug
Projects
None yet
Development

No branches or pull requests

2 participants