-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
API: Fixes #6862 set todo related fields when adding or changing a todo. Take 2 #7395
Conversation
The test is failing: https://github.com/laurent22/joplin/actions/runs/3601238236/jobs/6090068290#step:12:787 Do you know that you can run the tests locally? |
Yeah, I'm aware of that. I had all tests succeeding, but messed something up. My bad. |
packages/lib/models/Note.ts
Outdated
if ('is_todo' in o && o.is_todo === 0) { | ||
o.todo_due = 0; | ||
o.todo_completed = 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about the unintended effects of this. I don't see any reason why todo_completed or todo_due shouldn't be left as they are when is_todo is reset. What if for some weird reason some code somewhere is relying on these properties still being set?
It just feels like leaving them as they are won't cause any problems (calling code can check "is_todo" to know if they should care about todo_due and todo_completed or not). While removing them might.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I've removed this and its related logic
9ae3147
to
c1b7e16
Compare
Ok let's merge, thanks! |
todo_due
andtodo_completed
when adding a todo via the API. This fixes Due date is ignored when creating a todo via data API #6862todo_due
andtodo_completed
to 0 in Note.save() instead of in Note.changeNoteType()This is an alternative approach to #6886 with checks added to Note.save() instead of in the api.