-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
The API search filtered all notes when showCompletedTodos is set to false #5007
Comments
Hmm, in fact what's returned by the API should not be affected by the settings, so I think it was a mistake to add this "showCompletedTodos" condition to SearchEngineUtils. Or maybe it's a mistake to use SearchEngineUtils in routes/search.ts Actually we have a filter iscomplete:0/1, so is it not sufficient to filter based on whether a to-do is completed or not? Why do we need this support for showCompletedTodos in search? |
The PR was not meant to filter notes based on the option, but to hide the notes after a search. In the |
Right, on the UI side it does make sense. So I guess the bug could be that it's used in routes/search.ts. Maybe some option could be added like "applyUserSettings", and if "false" we don't filter based on "showCompletedTodos". Would that fix the original issue? |
Yes, I prepare fix. |
When searching for notes via the API and the showCompletedTodos is set to false and the fields is_todo and todo_completed should not be returned then all notes are filternd.
Environment
Joplin 2.0.1 (dev, win32)
Client ID: 3786010df4424355b5ac92d208168602
Sync Version: 2
Profile Version: 37
Keychain Supported: Yes
Revision: 68b5169 (test)
Steps to reproduce
Show completed to-dos
to disablehttp://localhost:27583/search?query=joplin&type=note&token=
Show completed to-dos
to enableDescribe what you expected to happen
showCompletedTodos
and always returns all matchesor
showCompletedTodos
and filterd the notes accordingly@laurent22 what do you think is the best option for the API search to handel this behavior?
I think for the API is almost the option 1 the best?
The behavior occurs since #4951
joplin/packages/lib/services/searchengine/SearchEngineUtils.ts
Line 54 in 68b5169
The text was updated successfully, but these errors were encountered: