API bug: fetching pages from folder includes Deleted by default

Operating system


Joplin version


Desktop version info

Joplin 3.0.12 (prod, darwin)

Client ID: 6a443486fb4247e8aba3b23a50ff505e
Sync Version: 3
Profile Version: 47
Keychain Supported: Yes

Revision: a64d6e3

Backup: 1.4.1
Rich Markdown: 0.13.3

What issue do you have?

Repro steps:

  1. through API, fetch notes for a folder, e.g. GET request to folders/${FOLDER_ID}/notes,

All deleted notes are fetched along with non-deleted.

Deleted notes should be excluded by default, as they are when calling the top-level (non-folder-specific) "notes" endpoint

I can easily work around this in coding but it would be less confusing for other developers who run into this if the behavior is consistent. I would suggest that all fetches to Notes endpoints not fetch deleted notes unless explicitly asked for. (The plain "notes" endpoint, which fetches all notes in the application, already works like this.)

As far as I can tell, the include_deleted flag has not been implemented for note search within a folder so there's no way to exclude deleted notes in folder note search. Since this is inconsistent with the above, I would suggest implementing this as a moderately high priority.

1 Like

That's a good point, it's now fixed in Api: Do not return deleted notes in folders/:id/notes call · laurent22/joplin@3e0fb48 · GitHub

That was very quick, thanks @laurent!